Yes, but a better question might be which ORM and how? With something like JPA you won't be able to directly map your model to the database. However you could construct your domain objects from a set of mutable "data objects" that are mapped using JPA. This does mean a chunk more code and more object allocation/garbage. However it does allow your domain model and data model to evolve independently (which may or may not be a useful thing depending on your use case). There are probably other tricks that you can do with JPA projections or different ORMs that have support for immutable objects. You may need to shop around.
Mike. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/ZG90VkxZS29CN1FK. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
