Pattern « Database « JPA Q&A





1. How to encapsulate database access?    stackoverflow.com

I am developing a transactional application in .NET and would like to get some input on how to properly encapsulate database access so that:

  • I don't have connection strings all over the place
  • Multiple ...

2. Which pattern does Hibernate follow?    stackoverflow.com

In his book "Patterns of Enterprise Application Architecture", Martin Fowler talks about persistence patterns which are commonly found in software development and particularly in relation to ORMs. Is there a pattern that ...

3. Storing historical data with Java and Hibernate    stackoverflow.com

This is a problem about historical data handling. Suppose you have a class MyClass like the following one:

class MyClass {
    String field1;
    Integer field2;
   ...

4. JPA: pattern for handling OptimisticLockException    stackoverflow.com

what is the correct pattern for handling OLE in a (REST) web service? this is what i'm doing now, for example,

protected void doDelete(HttpServletRequest request, HttpServletResponse response)
      ...

5. Pattern for externalizing database settings?    forum.hibernate.org

Hi, I'm wondering if anyone knows of a way to externalize the database settings that are typically stored in the hibernate config file; i.e. these values: jdbc:mysql://localhost/db myuser mypassword I'd like to be able to pull those values out and put them, say, in a separate configuration or properties file, or as environment variables or system properties, etc. ...