Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 681983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:32:41+00:00 2026-05-14T01:32:41+00:00

I’m about to write a Scala command-line application that relies on a MySQL database.

  • 0

I’m about to write a Scala command-line application that relies on a MySQL database. I’ve been looking around for ORMs, and am having trouble finding one that will work well.

The Lift ORM looks nice, but I’m not sure it can be decoupled from the entire Lift web framework. ActiveObjects also looks OK, but the author says that it may not work well with Scala.

I’m not coming to Scala from Java, so I don’t know all the options. Has anyone used an ORM with Scala, and if so, what did you use and how well did it work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:32:41+00:00Added an answer on May 14, 2026 at 1:32 am

    There are several reasons why JPA-oriented frameworks (Hibernate, for instance) do not fit into idiomatic Scala applications elegantly:

    • there are no nested annotations as states the Scala 2.8 Preview — that means you cannot use annotations as mapping metadata for complex applications (even the simplest ones often use @JoinTable -> @JoinColumn);
    • inconsistencies between Scala and Java collections make developers convert collections; there are also cases when it is impossible to map Scala collections to associations without implementing complex interfaces of the underlying framework (Hibernate’s PersistentCollections, for example);
    • some very common features, such as domain model validation, require JavaBeans conventions on persistent classes — these stuff is not quite “Scala way” of doing things;
    • of course, the interop problems (like Raw Types or proxies) introduce a whole new level of issues that cannot be walked around easily.

    There are more reasons, I’m sure. That’s why we have started the Circumflex ORM project. This pure-Scala ORM tries it’s best to eliminate the nightmares of classic Java ORMs. Specifically, you define your entities in pretty much way you would do this with classic DDL statements:

    class User extends Record[User] {
      val name = "name".TEXT.NOT_NULL
      val admin = "admin".BOOLEAN.NOT_NULL.DEFAULT('false')
    }
    
    object User extends Table[User] {
      def byName(n: String): Seq[User] = criteria.add(this.name LIKE n).list
    }
    
    // example with foreign keys:
    class Account extends Record[Account] {
      val accountNumber = "acc_number".BIGINT.NOT_NULL
      val user = "user_id".REFERENCES(User).ON_DELETE(CASCADE)
      val amount = "amount".NUMERIC(10,2).NOT_NULL
    }
    
    object Account extends Table[Account]
    

    As you can see, these declarations are a bit more verbose, than classic JPA POJOs. But in fact there are several concepts that are assembled together:

    • the precise DDL for generating schema (you can easily add indexes, foreign keys and other stuff in the same DSL-like fashion);
    • all queries can be assembled inside that “table object” instead of being scattered around in DAO; the queries themselves are very flexible, you can store query objects, predicates, projections, subqueries and relation aliases in variables so you can reuse them, and even make batch update operations from existing queries (insert-select for example);
    • transparent navigation between associations (one-to-one, many-to-one, one-to-many and many-to-many-through-intermediate-relation) can be achieved either by lazy or by eager fetching strategies; in both cases the associations are established on top of the foreign keys of underlying relations;
    • validation is the part of framework;
    • there is also a Maven2 plugin that allows generating schema and importing initial data from handy XML formatted files.

    The only things Circumflex ORM lacks are:

    • multi-column primary keys (although it is possible to create multi-column foreign keys backed by multi-column unique constraints, but it is only for data integrity);
    • full-fledged documentation (although we are actively working on it);
    • success stories of ten-billion-dollar production systems that have Circumflex ORM as it’s core technology.

    P.S. I hope this post will not be considered an advertisement. It isn’t so, really — I was trying to be as objective as possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I don't have much knowledge about the IPv6 protocol, so sorry if the question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.