Questions tagged [composite-id]
59 questions
0
votes
1 answer
hibernate Criteria on Composite Id
Below is the same code very similar to my code where i am facing the issue
//mapped to Table B
class B implements Serializable {
//Primary key bId
private Long bId;
//Getter and setter for bId;
}
//Mapped to table C
class C implements…

Amit Kumar Lal
- 5,537
- 3
- 19
- 37
0
votes
1 answer
jpa update for objects having comosite primary key
I have a composite primary key for my object.How can i use a jpa to update my object?
Normally we use the following code
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpa");
EntityManager em = emf.createEntityManager();
Student…

akp
- 1,823
- 7
- 26
- 29
0
votes
0 answers
@IdClass no supertype found
I want to make a table, let's say table's name is Car. It will has 3 column, brandId, typeId and sizeId. I want all of the columns to be primary key. typeId and sizeId are column from different table. I already try to make code using @IdClass. But,…
0
votes
1 answer
Composite Primary Key Error
I want to make a table, let's say table's name is Car. It will has 3 column, brandId, typeId and sizeId. I want all of the columns to be primary key. typeId and sizeId are column from different table. I already try to make code, but if I use…
0
votes
1 answer
JPA entities -- org.hibernate.TypeMismatchException
Environment:
JDK 1.6, JEE5
Hibernate Core 3.3.1.GA, Hibernate Annotations 3.4.0.GA
DB:Informix
Used reverse engineering to create my persistence entities from db schema [NB:This is a schema in work i cannot change]
Getting exception when selecting…

shane lee
- 1
- 1
0
votes
1 answer
Hibernate mapping issue with composite-id
I am using hibernate3 in my java app to access sqlserver 2008 enterprise.
The hibernate mapping uses composite id and when i try to load model it returns null. I spent days to resolve it but still no result. Composite id mapping should be used for…

taras
- 2,223
- 5
- 36
- 43
0
votes
1 answer
Composite id in hibernate+postgres breaks due to returned column order
I have a parent object with composite-id (legacy db - can't modify this). I have a child object that is a bidirectional one-to-many (parent-to-children) relationship. The mapping is correct, as I can load an instance of either entity and correctly…

ideasculptor
- 1,226
- 3
- 14
- 20
0
votes
1 answer
NHibernate subclasses and composite keys
I have a class StoreHours that has a composite key and has been working perfectly. A new demand came up for another type of hours to be returned. I thought "simple, I'll abstract the base class, have two concrete implementations and change my…

toxaq
- 6,745
- 3
- 46
- 56
0
votes
2 answers
nhibernate composite-id with not existing key-many-to-one record
i have old legacy DB which has dead links in their tables. I have class mapped in nhibernate like this:
…

Internal Server Error
- 249
- 3
- 7
0
votes
1 answer
Hibernate joining 2 rows
In order to make my java code easier, I would like to join two rows into one since I really need those two to be present in order to use the data.
Let's say those are the fields of my table :
ID, FIELD1, FIELD2, DISCRIMINATOR, VALUE
Obviously, ID…

Schumi77
- 1
- 2
0
votes
1 answer
Hibernate - Join Table with Composite ID
I have a Person Table (PersonID), and an Address table (AddressID). I want to create a new Join table called Person_Address which maps Person->Adress using a ManyToMany relationship and I have to specify the primary key as a composition of the two…

user1948363
- 11
- 4
0
votes
0 answers
hibernate composite-id as a part other composite-id
I try to write mapping to tables. I decided that id and versionId - composite-id for table test. But in table test_question I have composite-id consists from question_id, test_id and versionId. I can't understand as I can use one composite-id…

Ray
- 1,788
- 7
- 55
- 92
0
votes
2 answers
How to work around Session.get() strange behaviour with composite-id?
I'm trying to perform get on the session for object which declares composite id without a mapped composite identifier.
Hibernate version used is 3.5.5.
Fetching code is generic and reads container objects wrapping actual data:
ClassMetadata metadata…

aliher
- 415
- 1
- 4
- 13
-2
votes
1 answer
I have to rewritew composite-id (xml) to JPA
this is my xml mapping. I need to make JPA mapping
…

Dante
- 279
- 1
- 19