instance « Map « JPA Q&A





1. Can I have a collection of IUserType instances?    stackoverflow.com

Is it possible to have a collection of entities that are mapped via an IUserType? For example:

class Foo
{
    public int Id { get; set; }
   ...

2. Retrieiving domain object instances as a Map    stackoverflow.com

I wonder if there is a way to retreive domain instances as a Map where the key is the id of the domain object. more specific i would like to do myDomainObject.list() ...

3. Inconsistency Parent Child Herarchy / Can not instance    forum.hibernate.org

Newbie Joined: Wed Apr 07, 2010 10:46 am Posts: 4 Using this hbm, if I invoke the Division class and inside the Division class I invoke the class PartyRelationShip the InsuranceSupportStaff class is not suppouse tobe mandatory. The issue that why I got the error: Can not instance InsuranceSupportStaff is because it want to find a Division inside InsuranceSupportStaff. InsuranceSupportStaff is ...

5. initialize hierarchy from a child instance (lazy init excep)    forum.hibernate.org

Newbie Joined: Wed May 11, 2005 2:44 pm Posts: 5 Location: So Carlos - Brazil Hello everybody, I have the following parent/child hierachy in an single-user standalone application: Equipment.Calibration.CalibrationPoint.UncertaintySourcesCollection.UncertaintySource I adopted the detached object strategy and, also, I use cascade="all-delete-orphan" in all associations (one-to-many always). So, whenever the user change something in any instance of the above classes I call saveOrUpdate(Equipment) ...

6. Dynamic Mappings of Tables to Class Instances    forum.hibernate.org

I'm in the process of investigating different ways of managing very large numbers of rows in a single table. There are a number of solutions, including using native database partitioning or splitting the storing of the data among a runtime configurable number of tables. The data stored in the table is volatile i.e. lots of inserts, deletes & updates being performed, ...

7. How to map repeating group in a table to class instances    forum.hibernate.org

Hello, I need to map a (legacy) table containing repeating groups into a oo-oriented class model. Consider have following sample table CONTAINER with fields : ID Seal1 Seal2 Seal3 Color Material ... I want to map this information to 3 classes class Container { String containerID; } The repeating group needs to be mapped to a normalized class. class Seal { ...

8. Inheritance: Change an instance's class    forum.hibernate.org

Hi, I've got two classes like Car and Bike which both inherit from Vehicle and are stored using a single table strategy. Now I would like to change the class of a persistent object without changing its id. Yes, I do have a need for that :-) In plain database terms it would mean to modify the discriminator field's value for ...

9. Mapping multiple rows to a single class instance    forum.hibernate.org

Suppose I have a table which stores email addresses a user id has. A user id can have several email addresses, thus multiple rows in the table table email_user id_index INTEGER user_id CHAR(12) email_addr CHAR(50) and I have this java class representing this table class EmailUser { private Integer index; private String userId; private Set emailAddrs; // set of Strings ... ...





11. Dynamically modifying mapped instance class to superclass    forum.hibernate.org

Let's say I have three classes: class A { ... } class B extends A { ... } class C extends A { ... } They are mapped to DB using Hibernate's JOINED strategy. B myB = new B(); When I persist myB, I have A's attributes placed into table "A", and B's attributes placed into table "B". Now I want ...

12. How to instance of a collection in 1-M hibernate mapping?    forum.hibernate.org

Hi I have quiry on hibernate mapping in generating hql for the below scenario I have a ClassA (TableA) which has 1-M mapping to ClassB(TableB) In ClassA I have collection of ClassB (1-M mapping) When I run the hql based on the search criteria on ClassA. It is working fine and I am getting list of ClassA, with each ClassA instance ...