instance « Entity « JPA Q&A





1. Java JPA/Hibernate: How to avoid multiple instances of an entity in a session?    stackoverflow.com

I realize JPA doesn't work as I expected, as I often end up with multiple instance of a single entity in a session. Here's the study case: A parent has a collection ...

2. Is it possible to tell Hibernate to modify an existing entity instance    coderanch.com

John thanks for your reply, that might be the solution I was looking for. First, let me clarify my original question. What I'd like to achieve to have Entity do some logic on another object. // Mapped class reflecting table ENTITY public class Entity { private Foo f; // Foo is an interface, and it is not mapped by Hibernate private ...

3. CacheKey holds reference to entire entity instance as key?    forum.hibernate.org

Greetings, I'm trying to tune my Ehcache settings to deal with an issue of running out of old gen heap space. The current setup is MemoryStore only (overflowToDisk=false), Hibernate 3.3.1, and Ehcache 1.7.2. According to Hibernate: Truly Understanding the Second-Level and Query Caches, "The first thing to realize about the second-level cache is that it doesn't cache instances of the object ...

4. How can I create multiple 'instances' of an entity?    forum.hibernate.org

I would like to use an entity class within my application more than once but with each 'instance' write to a different table. example (not the actual situation): @Table(name = "Address") public class Address I would like to store multiple Address types in my Database each with their own table. I somehow have to change the table name for each instance. ...

5. How to obtain original state of entity instance bound to PC    forum.hibernate.org

Hibernate remember the original state of the object bound to persistence context. I'd like to obtain that state to build a set of changed properties. For example any JIRA issue contains a history of changes. It's not simple as might seem for the first glance because entityManager.find() method returns the already changed object. But I need the original state of the ...

6. Advice on keeping track of historical instances of an entity    forum.hibernate.org

Hi folks, I have a question on the correct way of keeping track of historical copies of an entity in database based on JPA+Hibernate: We have an entity in the database with a composite key based on a (generated) ID and the timestamp when this entity is saved into a table. This entity has a one-to-many relationship with another list of ...

7. Access entities in multiple databases one instance with 1 qr    forum.hibernate.org

Hi, I have a problem for which I can not find a sollution in Google / books. I have an informix server which holds 2 databases. Some entities I want to select from one database and others from the second database. There is also relation between the tables. Within informix SQL it is possible to select * from table1,otherdatabase:table2 where table1.name=table2.name ...