Database « Glassfish « JPA Q&A





1. Using multiple databases with JPA    java.net

Unless you can make one database hide the other (e.g. via views), each PU can refer to only a single database, and the scope of a JPQL query is limitted to a single PU. Your best options to have 2 PUs with each EMs from 2 EMFs managing objects from 2 different databases.

2. Question on JPA generating the wrong database commands    java.net

I have a set of entity classes that I'm using in a J2EE application (EAR). I am creating the database schema for these entity classes through an ant script which works fine. I also need to initialize a few of the entities once the database is created and because it was easier, I wrote a standalone persistence application to do so. ...

3. JPA + database triggers or other non-JPA db manipulation    java.net

I am asking, because I have application that is using JPA, but JPA is really bad for massive data modifications. In my case, I have few services like the one that has to update about 20.000 records - calculation of interest on every active loan. The result of that will create Transaction entities, AccountEntry entities, it has to update loan's checkDate/status ...

4. JPA with database Views    java.net

@Column(name = "ROLE_NAME", unique = false, nullable = false, insertable = true, updatable = true, length = 128) public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } @Column(name = "ENTITY_TYPE_ID", unique = true, nullable = false, insertable = true, updatable = true, length = 4) public String getEntityTypeId() { return entityTypeId; } public void ...

5. Limiting ammount of Data JPA pulls from Database    java.net

> This is a contrived example because you would > hopefully never make an Order that was so big that > paging would actually be a concern, but you see what > I mean. > > Less contrived: What about other areas of an > application? System.getUsers(), for example, might > be one of those APIs where you start out by ...

6. When/why does JPA flush to the DB?    java.net

[i]The persistence provider runtime is permitted to perform synchronization to the database at other times as well when a transaction is active. The flush method can be used by the application to force synchronization. It applies to entities associated with the persistence context. The EntityManager and Query setFlushMode methods can be used to control synchronization semantics. The effect of FlushModeType.AUTO is ...