Record « Association « JPA Q&A

1. Hibernate: delete records from association table with foreign keys

I'm new in hibernate. So, I don't know how to do this: I have 3 tables: Table Person:

@Table(name = "ASD_PERSON")
public class AsdPerson implements Serializable {
    @SequenceGenerator(name="seq_name", ...

2. Record from an association table does not get deleted.

Hi, Am using hibernate 2 and am a new user. I have two persistent classes and I have a - Set favouriteEvents defined in my User class. This keeps track of the users favourite events. I have one event and 2 users in the database currently. I have one record in the favouriteEvents table that relates user 2 to ...

3. Insert new records with associations

4. Association returns null Set even though records exist

Hi, I generated my Hibernate mapping documents using Middlegen, middlegen generates separate classes for the composite keys. I have a one-to-many association between 2 tables, both these tables have composite primary keys and hence their own individual primary key classes. Records from the second class (the many side of the relationship) are stored in a set of the POJO of the ...

5. Filtered collection association+no records = not initialized

Hello, I have a collection association, privileges of user. There is a filter in collection, so only valid privileges are loaded. If filter is enabled and association join-query returns no records, collection is not initialized. And when I try use that collection outside of session I get LazyInitializationException. If filter is enabled and association join-query returns at least one record, collection ...