Production « Test « JPA Q&A





1. Supporting Different JPA GenerationTypes for Test/Production    stackoverflow.com

I want to use GenerationType.IDENTITY for primary keys in my production MySQL system. But for local development and testing, I'd like to use HSQLDB. The problem is that HSQLDB doesn't support ...

2. How to define two persistence units (one for production, one for unit testing)?    stackoverflow.com

This is my stateless bean:

@Stateless
public class Finder {
  @PersistenceContext(unitName = "production")
  EntityManager em;
  [...]
}
It explicitly defines that the name of persistence unit is production. This unit is configured ...

3. Best practice to get EntityManger for either Test or Production    stackoverflow.com

I'm creating a JPA-based application, and I need the EntityManger in a lot of diffferent places. So I'm creating a singleton class that returns the entity manager:

class MyDB {
   ...

4. configuring hibernate for production and testing    stackoverflow.com

In my web app,I am using hibernate and hsqldb for database operations..and use Ant for build management.I have a local.properties containing db.url,db.driver etc.They contain production db values. In hibernate.cfg.xml ,I am again ...

5. How to connect to different databases (development/test/production) transparently with hibernate    stackoverflow.com

I have several different databases for different environments to connect my application to. These are constant per installation but differ between them. In other words there is

  1. A development environment which connects ...