value « Entity « JPA Q&A





1. How to store some of the entity's values in another table using hibernate?    stackoverflow.com

is there a simple way to persist some of the fields in another class and table using hibernate. For example, I have a Person class with name, surname, email, address1, address2, city, ...

2. JPA get values from the collections in entities    stackoverflow.com

I'm new to JPA and now stuck with a problem! I have two tables Person and PersonAddress. In the Person entity, I have

@OneToMany(mappedBy="personid")
private Set<Personaddress> personaddressCollection;
and
public Set<Personaddress> getPersonaddressCollection() {
    return this.personaddressCollection;
}

public ...

3. Read Hibernate entity identity value    stackoverflow.com

Does Hibernate have an API for reading the value of an entity's identity field? In my case, this would be the Serializable value returned by the field annotated with @Id. For ...

4. Can I return Hibernate Entities as return value in JAXWS web service methods?    stackoverflow.com

Can any one say to me that can I return Hibernate Entities as return value in JAXWS web service methods!? Indeed I have some Entities like these:

@Entity
public class Parent {
...
   ...

5. Filter Hibernate entities by the presence of a value in a many-to-many collection    stackoverflow.com

I have a Hibernate entity (A) that contains a many-to-many collection of other entities (B). I'm attempting to use Hibernate filters (using @Filter and @FilterDef) to only select those A entities whose ...

6. Entity and value types in hibernate    stackoverflow.com

What is the difference between entity and value types at the object level. I understand that entity will have an id but value won't but why do we need different ways ...

8. How do I get entities which contain ALL values    forum.hibernate.org

@Entity public class ContactEntity { ... private Collection eventInstances; @JoinTable(name = "contact_event", catalog = "kbc", joinColumns = @JoinColumn(name = "contact_id"), inverseJoinColumns = @JoinColumn(name = "event_id")) @ManyToMany public Collection getEventInstances() { return eventInstances; } public ...

9. Question about entities and values    forum.hibernate.org

public class Foo { private String bar; public String getBar() { return bar; } public void setBar( String bar ) { ...





10. Reference Data: Value or Entity?    forum.hibernate.org

I do not have bug. I just have situation with various alternative solutions and wanted your opinions on which is best. The domain layer developer here always makes things complicated for me (I am persistence layer developer and data modeller). This situation no different. Domain layer guy is building accounting system that can account for money but also for quantities of ...

11. Original Entity Values    forum.hibernate.org

Hi, Is there a way to get the original values of a property using Hibernate? i.e. For all our entities we need to support an addiational getter "getOriginalValue()", as Hibernate uses an internal cache to maintain the state or to find out "isDirty()", is it possible to expose this functionality to the application? Thanks, Mel

12. Dirty checking of entities v/s scalar values - newbie Q    forum.hibernate.org

Hi, Have just started playing around with this tool... I have read that Hibernate does a dirty checking of entities whenever it tries to flush changes to the database. I presume this happens within the first level cache wherein it checks with the cloned object whether changes have happened or not.....It makes sense for entities However, if I got a list ...

13. Value object or entities    forum.hibernate.org

hi all, Consider an entity model which has 2 entities ACCOUNT and TRANSACTION. ACCOUNT can have multiple TRANSACTIONs. Further each TRANSACTION is associated with a amount attribute. On a web front end I would like to show the ACCOUNT and the sum of amount of associated TRANSACTIONs. How do you propose this be should be efficiently implemented in hibernate. One of ...

14. Entity vs. value type    forum.hibernate.org

Hi "Java Persistence with Hibernate", page 161: "You'll often find this kind of mixed behavior; however, your first reaction should be to make everyting a value-typed class and promote it to an entity only when absolutely necessary." Would anyone care to provide more details on why this is true? In my experience, this seems fairly odd. For instance, I have a ...