element « Map « JPA Q&A





1. How to query for map element in hibernate?    stackoverflow.com

I have a hibernate mapping which looks like this:

<hibernate-mapping>
    <class name="MutableEvent" table="events"
        mutable="true" dynamic-insert="true" dynamic-update="true">

       ...

2. Using nhibernate element with HQL queries    stackoverflow.com

I'm attempting to use an HQL query in a <loader> element to load an entity based on other entities. My class is as follows

public class ParentOnly
{
    public ParentOnly(){}
  ...

3. Hibernate criteria query to match against all child collection elements    stackoverflow.com

This question is very similar to this one but the responses were minimal to that question. I have a parent class with a Set of child entities. The child entities are ...

4. JPA: When to choose Multivalued Association vs. Element Collection Mapping    stackoverflow.com

I would like to better understand the differences between (1) a traditional Multivalued Relationship/Association

   @Entity -> @OneToMany -> @Entity
and (2) the JPA2 Collection of Embeddable (and basic) ...

5. NHibernate 3.0 Linq query against element instead of using HQL    stackoverflow.com

I have a mapping that looks like this:

  <class name="Record">
    <map name="Values">
      <key column="RecordFK"/>
      <index column="FieldFK"/>
  ...

6. How to configure an Element-collection to map an existing DB table in JPA orm.xml configuration?    stackoverflow.com

I have migrated an app from a full-Hibernate featured one to a JPA/Hibernate based-one and I have a problem with my JPA mapping. We have managed to use orm.xml to map our ...

7. Error on HQL Query distinct count of child collections (in elements error)    stackoverflow.com

First of all, please forgive me for my vocabulary is a little limited with NHibernate so I might call something the wrong thing...here is my question: Result I am looking for is ...

8. Validating Hibernate mapping file with -set- and -join- elements    coderanch.com

Using Hibernate 3 I have a problem validating a mapping file that contains and elements. Java classes: public class Agent { private Long id; private lastName; private firstName; private String agentNumber; private Date startDate; private Date endDate; private Set retailProperties // getters and setters for each property } public class RetailProperty { private Long agentId; private String propertyCode; private ...





10. hibernate, join fetch existing collection in elements of map    coderanch.com

Hello everybody, So.. im trying to bring some relationchips in a HQL query where the structure begins to be so complicate to be developed. I have something like this: public class Fabrica { private Map carros; } public enum EnumCarro { CARRO_A,CARRO_B } public abstract class Carro { private EnumCarro key; } public class Audi extends Carro { private List acess; ...

11. deletion of child elements when trying to delete parent    forum.hibernate.org

Newbie Joined: Thu Feb 03, 2011 7:44 am Posts: 1 tHIS IS MY CODE : wHEN I AM TRYING TO DELETE THE DATA FROM PARENT TABLE IT IS NOT AUTOMATICALLY DELETING FROM THE CHILD TABLE...HERE ARE MY ENTITY CLASSES - STUDENT.JAVA(parent table) and Phone.java(Child table) Code: import java.util.List; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import ...

12. Getting Exception when adding a element inside mapping    forum.hibernate.org

Hi everybody, I'm getting a strange behaviour on my mapping file when I try to add one-to-many relation between two beans. This is the mapping: .............. ...

14. problem referencing a map element in HQL    forum.hibernate.org

The query I am trying to get to work is select r from QuoteRequest r where r.coverSheet.actions['Provider_In'].parameter.stringValue = '123456' that is - each QuoteRequest has a coversheet component which has a Map called actions whose values are the parameters i am interested in here is the mapping

15. question about new elements and maps    forum.hibernate.org





17. A Map collection having elements being Sets ?    forum.hibernate.org

Well, I know how I could return the complete list of dependent versions for a version.... Set dependentVersion version.getDependencies(); Having a Set mapped with "many-to-many" (or with an intermediate class) But, then I would have to filter that set for component of the specific type I want. I would like to avoid this. I would like version.getDependencies() to return a Map ...

18. Querying by child Collection element properties    forum.hibernate.org

19. How to operate in HQL with a Map element    forum.hibernate.org

I have mappings like this: public class Foo { private Long id; private Map barMap; ...//getters, setters } public class Bar { private Long id; private String name; } with class Foo, the key of barMap is an object of Bar, and the value is a Date. ... ...

20. Mapping fails to parse with discrimator element    forum.hibernate.org

...

21. Problem with mapped query and element    forum.hibernate.org

Sorry, I didn't mean to rate the previous post unhelpful, it didn't solve my problem, however it WAS helpful and deserve credit - I understand now the reason but I actually dont want to repeat the column, hibernate is forcing me to repeat the column because the mapped query can't "see" the nested in tag. Thanks.

22. How to map a map-key as a property of the element?    forum.hibernate.org

Map map; class Element { String name; ... } The following mapping produces two columns with the same content: I'd like to map this Map without duplicate columns. The key of the Map is also contained as a property of the element. Is there a way to map this without having duplicate ...

23. invalid mapping The content of element type "class"    forum.hibernate.org

Newbie Joined: Mon Jul 11, 2005 8:34 am Posts: 12 Hi everyone, I've searched all over for this error but I can't figure out what's going on! :( I've already double checked the database name, fields, types, package paths against the xml and classes and they all match. and I only get the error on one particular hbm.xml mapping file when ...

24. Error Deleting Collections which are child elements    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: HIbernate 3.1 I have a parent class and it has a one-to-many relation to a child class meaning there are a collection of child elements belonging to the parent class. When i try to delete the parent by setting the identifier of the parent object, it doesn't cascade the ...

25. How to query single elements in mapped maps    forum.hibernate.org

Hibernate version: 2.18 Mapping documents: Code: ...

26. cascade delete does not delete child elements    forum.hibernate.org

Author Message orome Post subject: cascade delete does not delete child elements Posted: Thu Jan 19, 2006 6:28 am Newbie Joined: Wed Dec 14, 2005 6:50 am Posts: 17 We are stuck in the following problem: In a parent-child mapping situation we use cascade (Ibistarget=parent, Ibisaction=Child), so the children are managed by the parent. This works fine as long ...

27. Problem persisting elements (values vs. entities    forum.hibernate.org

Author Message abc-xyz Post subject: Problem persisting elements (values vs. entities Posted: Mon May 15, 2006 3:09 pm Newbie Joined: Mon May 15, 2006 1:59 pm Posts: 3 Version 3.1.3 When a Map field (data member) of a persisted object contains "value" elements, changes made to that map are not persisted, as opposite to the situation when a ...

28. Mapping : specify where-clause for join element.    forum.hibernate.org

...

29. Map/Set updating every element on save    forum.hibernate.org

I started a topic a while back and I've narrowed the problem. If you resave an in-memory object, Hibernate will UPDATE every associated Set/Map element even though they haven't changed. If I load the object from Hibernate (replacing my in-memory version), then this extraneous UPDATE problem doesn't occur. This seems like a bug, different saving behavior depending on whether it's the ...

30. Mapping repeatable xml elements    forum.hibernate.org

Newbie Joined: Thu Mar 08, 2007 4:28 pm Posts: 2 I am trying to persist some xml with xml-relational mapping using Hibernate. The xml instances have multiple instances of repeatable elements. E.g., Code: bbcards000001 3-5-2007 bbcards ...

32. Can not avoid joins to child elements    forum.hibernate.org

Hi, I am using a table per class strategy (). For example: @Entitiy @Inheritance (strategy=InheritanceType.JOINED) Class Person{ private long id; private String name; private int age; ...... } @Entity Class Pupil extends Person{ .... } @Entity Class Teacher extends Person{ ..... } The purpose is to create a criteria/hql that returns the Person(or persons name) without joining to Pupil and Teacher. ...

33. Mapping a Collection of Elements using an SQL Query    forum.hibernate.org

Hello fellow hibernaters, I have a persistent entity with a property that is a collection of primitives (a Map), and I want this collection to be loaded automatically using a native SQL query. This is a read-only collection, so I only need it to be loaded along with the object. Is this possible? It seems like is the closest ...

34. How to map a where element is a of e    forum.hibernate.org

35. How to map a where element is a of e    forum.hibernate.org

msenin wrote: My short-term solution is ugly but it works. I'd like to solicit a better idea. I guess, the ideal solution would be a hibernate mapping. My first attempt was to use map-key-many-to-many (like yourself), only to discover that the index column had to be unique (ie. the primary key of the join table is a combination of the two ...

36. HQL can't handle elements in set mapped by key    forum.hibernate.org

Using Hibernate 3.2.5 We have entities User, Role, Group. The User class has a Map of Roles to sets of Groups. Since the value class of a map must be a mapped entity itself, we created another mapped entity "GroupSet". class User { private Map groups; } class GroupSet { private Set groups; } So now - how to find the ...

37. Persisting xml data including child elements    forum.hibernate.org

Newbie Joined: Sat Jul 26, 2008 10:13 am Posts: 3 Hi I am attempting to persist xml data into a database with Hibernate. The Account table is created and the elements are persisted, but I cannot get the child Contact elements to be persisted, although the Contact table is created. I have tried many mapping file configurations but no matter what ...

38. Document root element "hibernate-mapping", must ma    forum.hibernate.org

Hello, all! problem: +-----------------------------------------------------------------------------+ %tomcat_home%\logs\stdout_20090311.log: +-----------------------------------------------------------------------------+ 14:27:35,406 INFO Environment:520 - Hibernate 3.3.0.CR1 14:27:35,406 INFO Environment:553 - hibernate.properties not found 14:27:35,406 INFO Environment:687 - Bytecode provider name : cglib 14:27:35,421 INFO Environment:604 - using JDK 1.4 java.sql.Timestamp handling 14:27:35,500 INFO Configuration:1437 - configuring from resource: /hibernate.cfg.xml 14:27:35,515 INFO Configuration:1414 - Configuration resource: /hibernate.cfg.xml 14:27:35,593 INFO Configuration:563 - Reading mappings from resource : ...

39. map index element must specify a type (?)    forum.hibernate.org

Newbie Joined: Wed Jul 22, 2009 6:46 am Posts: 3 Hi, I am quite new to hibernate so this might be an newbe-problem: I am trying to persist a collection (HashMap) with Hibernate. I am getting an org.hibernate.MappingException: map index element must specify a type: eu.basi.fax.core.FaxCampaignImpl.jobs Can anybody tell what this message means an how it can be recovered? This ...