primary « Load « JPA Q&A





1. Shared primary key in JPA and lazy loading problem    stackoverflow.com

I have a problem with shared primary keys. My scenario is, i have 2 tables sharing same primary (one-to-one) relationship. Initially i hav problem with mapping shared primary keys but i solved ...

2. Hibernate proxy loading with only the primary key    stackoverflow.com

We have the following relation:
A car is owned by a person.
A person can own many cars. Here is the mapping for the car :

<hibernate-mapping package="fr.recouv.scribe.core.bo">
<class name="Car" table="car">
 <id name="id" column="id_car" unsaved-value="0">
  ...

3. Lazy loading issue with composite primary keys    forum.hibernate.org

Hello, I have two entities Enterprise and EnterpriseGroupDefault. Enterprise is the parent entity. EnterpriseGroupDefault has composite primary keys. Its mapping is given below: Code: ...

4. Exception thrown when trying to load with primary key:String    forum.hibernate.org

Hi, I am using the Hibernate Session load() method to load an object. However, if the primary key is a String I get an exception. Syntax of load method used:- public Object load(Class theClass,Serializable id) throws HibernateException The code is as follows:- public void load(CommandInExecution cmdExec,BusinessEntity entity, Object primaryKey) throws PersistenceException { Class classObj = entity.getEntityDefinition().getModelImplClass(); HibernateExecutionContext ctx = (HibernateExecutionContext) cmdExec; ...

5. load object without primary key and HQL    forum.hibernate.org

sunilkumarsh wrote: I am using hibernate 3 version. I want to load the object without passing the ID. I dont want to use HQL. What I want is .....suppose i have class employee with few records in it. and I want all the records from this class now the question can this be done without using HQL. If yes how ? ...

6. load/get L2 cache and surrogate/primary key    forum.hibernate.org

Hello, I have a users table that has a autonumber identifier for the primary key and that is what the id is mapped to in hibernate. I have another column that is the username column which is unique and is a surrogate/natural key. Often I am faced with having to load a user by their username (e.g. remember-me) and not by ...

7. can't load table with no Primary Keys    forum.hibernate.org

Newbie Joined: Thu Nov 09, 2006 7:07 am Posts: 2 I need to use hibernate to retrive data from a table with no primary keys.the table has a combination of 4 columns which together make up the pry key.I'm using the hibernate composite-id mapping but i'm having difficulty loading the object in hibernate.I don't know wot i'm doing wrong.Pls i need ...

8. No lazy loading with n:1 to non-primary-key    forum.hibernate.org

hi, thank you for your replies. Okay, this is another topic for the problem. But I can't understand it. What is the difference between pk and an unique not-null key? Emmanuel wrotes: "object unicity"? But a foreign-key without an associated primary-key is also possible. Our legacy database includes 250 tables. I dont wont create more tables for hibernate-lazy load ;-) This ...