1. Using Hibernate with the Java List forum.hibernate.orgAs I see it the answer you got from araqnid on stackoverflow is correct. Technically it would also be possible to use a |
2. Hibernate projection for a list of entities. forum.hibernate.org |
3. Hibernate List Index null problem forum.hibernate.orgHi friends. I was using a Set but now due to a widget restriction, I need to use a list.a a sample of my mapping file using A SET and a List are as follows. Can someone help me to place the list index. I am getting some confusion. **Attribute Mapping File using Set** ?xml version="1.0"?> |
7. query.list() returns empty result after manual editing of DB forum.hibernate.org1.) Initially the Image table in my DB has no records. 2.) I am executing the below method. The size is correctly displayed as zero. 3.) Now I am manually inserting 3 records through Mysql Query browser. 4.) Again I am executing the below method. ** watch** the size is still zero 5.) the manual changes I made are not getting ... |
8. Sentece HQL for List attribute in a Entity Class forum.hibernate.org |
9. How do I map Map |
10. Problem With list method forum.hibernate.org |
11. HQL query with list compare forum.hibernate.orgCan someone help me with my query? I have an custom object defined with a list of strings in it. These string are id's of a different type I have a list of strings of those id's with which I want to check equality against. public class Foo { @CollectionOfElements(targetElement = String.class) private List |
12. HQL query with list compare forum.hibernate.orgCan someone help me with my query? I have an custom object defined with a list of strings in it. These string are id's of a different type I have a list of strings of those id's with which I want to check equality against. public class Foo { @CollectionOfElements(targetElement = String.class) private List |
13. Query.list() return proxy forum.hibernate.orghi,is there someone tell me when Query.list() return proxy?? I had a problem,my code is below Code: @SuppressWarnings("unchecked") public List find(String hql, Object... values) { Query q = createQuery(hql, values); return q.list(); } the createQuery method is: Code: /** ... |
14. problem while getting list element from entity in hql query forum.hibernate.orgselect aliasname.listelement from entity is working fine for me with out any porblems... But if i am writing :- select aliasname.string, aliasname.listelement from entity I am getting missign expression error ...i dont want to get the entire entity as it is too heavy. can some one suggest me a way at the earliest. |
15. Foreign key restrictions in |
16. problem with ordered list forum.hibernate.orgHi All, I'm having a problem with an ordered list and would greatly appreciate any help. Configuration: An AlbumGroup contains a list of Albums. It is not a bi-directional relationship. Code: |
17. hibernate returns list , can it return Map forum.hibernate.orghi friends, I am developing an application in struts2 and hibernate and i dont like the list returned by hibernate create query function on session, actually if i tie the list to a variaable and access in jsp then i have to rely on object index rather than name, It is becoming complicated to remember the index of the list variable, ... |
18. Store the same entity in mulitple Lists forum.hibernate.orgHi Im very new to Hibernate so this will probably a easy task for you guys. As the Topic says I'm trying to reference the same entity in multiple Lists. But when I try to do so I get an exception saying: "Duplicate entry '5' for key 'military_id'". I googled but could not find a solution to my problem. I have ... |
19. 3 Lists fetching in the same table with 3 differents filters forum.hibernate.orgAuthor Message ergu Post subject: 3 Lists fetching in the same table with 3 differents filters Posted: Wed Mar 16, 2011 7:37 pm Newbie Joined: Wed Mar 16, 2011 7:29 pm Posts: 1 Hi there, i'm glad to join this magnificent community! This is my first big problem i'm getting and i hope that you cian help me out!!!!! ... |
20. Order By Value in Map of List of Map of etc forum.hibernate.orgI have a persisted object with a map field that can stores key values pairs. The value in each pair can also be another map of the same type or a list or a value. The list can also contain maps, list or other values. The list, map and value classes all share a common abstract superclass which is the class ... |
21. Hibernate return list with NULL objects in it forum.hibernate.orgHi, I am using criteria query to fetch list of records from database VIEW. I have created the corresponding HBM.xml and POJO files. OuterView.hbm.xml corresponds to OuterView.java, which contains a composite key of class InnerView.java. OuterView.java contains only one attribute as InnerView and InnerView contains all the column names and their getters and setters. I am creating criteria on OuterView.java and ... |
22. Query.list() return type forum.hibernate.orgHi I am trying to do simple query (get all names) on the table using Hibernate. For that I write a simple business logic function getAllName() as follow: Code: public ArrayList |
23. Dependency to PersistentSet - List - Distributed data forum.hibernate.orgI saw that there is many users that talking about avoiding dependency with Hibernate, especially with the Persistent* (Collection Set/List, ...) class/package when POJOs are "probably" used in distributed environment. Data are serialized and sent to a remote computer under the form of Java Object - I suppose so - This my case and I got a ClassNotFoundException because there is ... |
24. Hibernate query return empty list. forum.hibernate.orgHi, i've a problem. I developed a J2EE project using Spring and Hibernate. This project working fine but i've changed a db table and now all queries returns empty lists. The same queries working fine on SQL db engine. The table is correctly mapped and i don't get any errors or warnings on xml files. Also the table contains many records. ... |
25. Calling hibernate query list() method generates errors forum.hibernate.org//JobEntity @ManyToOne(cascade={CascadeType.MERGE, CascadeType.REFRESH}, fetch=FetchType.EAGER) @JoinColumn(name="job_id", nullable=false) private Job jobId; @Column(name="grp_id") private String grpId; @Id @Column(name="id", nullable=false) @GenericValue(strategy=GenerationType.SEQUENCE,generator="JOB_ENTITY_SEQUENCE") private Integer id; |
26. List results of an annotated class forum.hibernate.orgHello There. I'm facing a problem that it's driving me nuts, it never happened to me before, so that's because I'm begging for help I got an annotated class with 3 fields Code: @Entity @Table(name="all_input_sources",schema="store") @Immutable public class SourceView { @Id private String source_type_name; ... |
27. Using Hibernate Lists forum.hibernate.orghi guys I am using hibernate with SQL server 2005 database. I have three tables. The tables are Project PROJECT_ID (PK) Name Users USER_ID (PK) Fname Lname Project_Users PROJECT_ID (PK) USER_ID (PK) Role The requirments are straight forward: 1. one project can have multiple users. One user can work on multiple projects. 2. When user is searched by UserId, all the ... |
28. Want to select list and one column using select query forum.hibernate.org |
29. Report query with a list attribute? forum.hibernate.orgShow A | Episode 1 | Episode 2 | ... Show B | Episode 1 | Episode 2 | ... Show C | Episode 1 | ... |
30. Hibernate not updating list order forum.hibernate.orgI originally thought I had posted this in this forum, but it looks like it ended up in the Nhibernate forum, so I am re-posting it here. I am trying to reorder a list selection within the database. Say I have a choice set called "Cities" and have several cities as children of the "Cities" choice. I have a method to ... |
31. criteria on a non mapped class returns an empty list forum.hibernate.org |
32. Official List of aggregate functions? forum.hibernate.org |
33. Problem with obtaining last item of the list. forum.hibernate.orgHi! I can't understand what's your final expectation....class Activity (A entity) has a list of class TodayEffort (B entity), you want to retrieve A instances whose property "effort" of last item of entities B related to A is not null... Have you tried left outer joins, like "...on a.id = tes.activity" ? |
34. Adding entities to persistent list forum.hibernate.orgI'm definitely quite stuck working with persistent lists. The XML mapping of the entities involved are as follows: |
35. List within a list? forum.hibernate.orgI have been working several hours on creating a list within a list in hibernate. I have a parent object with a list of children, and each child can have a list associated with it. Parent table parentid, (several fields) From the mapping: |
36. createSQLQuery result get entity list forum.hibernate.orgHi, I have 1-many relationship between 2 tables, Parent and Child. I want to use sql query to get list of all parents with children initialized for each Parent (using left join). For now I want to do it with native sql only. Code: SQLQuery sqlQuery = session.createSQLQuery("select * from test_parent p left join test_child c on p.id_parent = c.id_parent"); ... |
37. @ElementCollection of List |
38. List Collection having it's order reversed forum.hibernate.orgHi, I have a OneToMany relationship in one of my entities that uses a List to hold the associated entities. Code: @OneToMany(targetEntity = AccountSqlBean.class, cascade=CascadeType.ALL) @JoinTable(name="AccountSqlBean_AccountSqlBean", joinColumns = @JoinColumn(name="ID")) public List |
39. PersistentList internal list has thousands of null entries forum.hibernate.orgIt seems as if the PersistentList class pads its list with null values up to the index value of the first item being added. In our application, that item could have an index of over 1 million which causes 999,999 null entries to be added to the list. Heap analysis shows this list to be in the 11mb range which is ... |
40. How to Parse Multitple Entities In NativeSQL Returned List forum.hibernate.orgHi, In some of the code of my application, the Native SQL is required somehow so that I could use the xpath syntax to search a XML column in our Ms SQL database. And in the Native SQL I need to return a list with multitple entities. From the url http://docs.jboss.org/hibernate/core/3. ... l#d0e13763 , I able to find a sample of ... |
41. Detached objects list forum.hibernate.org |
42. Criteria: Object containing list of object forum.hibernate.org List |
43. How to get the ResultSetMetaData for SQLQuery.list()? forum.hibernate.orgHi, We are on Hibernate core 3.3.1.GA. A requirement is forcing us to do a straight SQL query. Part of it specifies that we need to return the column names along with the values. Looking through the API, I don't see a clear way to get at the metadata. So, for now we did a straight JDBC query, but as you ... |
44. Need help on maintaining list with one-to-many mapping forum.hibernate.orgHi, I am new to Hibernate. In my application I am maintaining a one-to-many mapping for a List. The mapping in the hbm file looks like this: |
45. JPA restrict column list in select forum.hibernate.orgI have a Simple class hierarchy (with InheritanceType.JOINED strategy): C extends B extends A In a select using jpql I want to retrieve only the "A part" of my data. I try the following query but it always returns complete C object select object FROM A object WHERE TYPE(object) = A I also try the TYPE function but it act as ... |
46. Add element in ManyToMany List results in join table cleaned forum.hibernate.org |
47. @CollectionId on a List. Equals fails. PersistentIdentifier forum.hibernate.org@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinTable(name="KW_TARGET_OPERATION_TEMPLATE_XREF", joinColumns={ @JoinColumn(name = "TARGET_OPERATION_ID") }, inverseJoinColumns={ @JoinColumn(name="TEMPLATE_ID", referencedColumnName="TARGETING_TEMPLATE_ID") }) @GenericGenerator(name="TARGET_OPERATION_TEMPLATE_XREF_GENERATOR", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = {@Parameter(name = "sequence_name", value = "KOBE_MART_TBLS.KW_TARGET_OPERATION_TEMPLATE__TARGET_OPERATION_TEMPLATE_XRE_SEQ")}) @CollectionId(columns = @Column(name = "TARGET_OPERATION_TEMPLATE_XREF_ID"), type = @Type(type = "long"), generator = "TARGET_OPERATION_TEMPLATE_XREF_GENERATOR") ... |
48. Core 4.0CR2: Mapping exception Unknown entity java.util.List forum.hibernate.orgSEVERE: Allocate exception for servlet mainservlet org.hibernate.MappingException: Attribute [_repos] refers to unknown entity: [java.util.List] at org.hibernate.metamodel.source.internal.AssociationResolver.resolve(AssociationResolver.java:57) at org.hibernate.metamodel.source.internal.AssociationResolver.resolve(AssociationResolver.java:44) at org.hibernate.metamodel.source.internal.MetadataImpl. |
49. Error when moving elements in a list (@OrderColumn) forum.hibernate.orgHi, i have a problem when reordering elements in a list with child entities on a parent entity. Getting the children ordered works fine (I added the @OrderColumn annotation) but when moving one element in this list I always get an ConstraintViolationException. Example: My parent is "MyParent" which has children. The list contains the elements: B, D, E, G, H, J ... |
50. Empty PersistantBag returned when getting a List forum.hibernate.orgSo I, like many people, am trying to get a list of objects out of my database. I can insert them just fine. Getting them back is another issue. When I create the database and insert the objects, everything is inserted fine. The data DOES Exist. It does not get returned. When I run a debug and inspect the object returned, ... |
51. Lazyinitializa Exception: when add new element to empt list forum.hibernate.orgHello friends, I am stuck with this issue. The problem is when an empty collection is returned by hibernate and I try to add a new element to it, hibernate raises the error "collection is not associated with any session". But when this collection has one or more elements then hibernate allows me to add new element. |
52. Store List forum.hibernate.org |
53. Mapping strategy for lots of List |
54. logback missing values in parameter list forum.hibernate.orgMy logback setup is apparently dropping some of the sql parameters. Has anyone seen this? It's possible the missing values are in fact null. Can I rely on this? I'm using ch.qos.logback:logback-core:jar:0.9.18 spring-framwork 3.0.1 java 1.6 I have this in my logback.xml |
73. Retrieving my objects from a list forum.hibernate.orgI'm having some trouble with this: Session sess = sessions.openSession(); // obtain a JDBC connection and // instantiate a new Session Query q = sess.createQuery( "select di.drugCode, di.drugName " + "from PortalDrugItem as di " ); List result = null; result = q.list(); System.out.println(result.size()); ArrayList list = new ArrayList(); Iterator iter = list.iterator(); while ( iter.hasNext() ) { System.out.println("Hi"); PortalDrugItem foo ... |
74. Retrieving raw list from read-only table forum.hibernate.org |
75. List collection not filling in "child" reference f forum.hibernate.orgHowdy, I'm trying to create an ordered parent/child relation using a list collection (I need to keep the items in order and list seemed the way to go). I can basically get it to work - when I save the "parent", hibernate saves it and persists the "children" that I've added to the parents list/collection property. So I'm pretty sure I'm ... |
76. Problem with List, when Set works fine forum.hibernate.orgI have a collection of a Set that works fine, but when I convert it to a List it throws a NP Exception when iterating over the objects. Dubugging it it looks like the Object is good and well until I cast it with the Iterator.next(). I am using H2-Beta4. Here are my mappings: WORKS: ----------- |
77. force initialize lazy list forum.hibernate.org |
78. Sets and lists forum.hibernate.orgI'm from the RDMS school of thought and am wondering... in what cases does it make most sense to use a Set and when does it make most sense to use a List? Are there any general rules of thumb? Can I get away with always using Sets for collections (i.e. what I think of as N-to-many relationships) |
79. Manipulating lists and index problem! forum.hibernate.orgNewbie Joined: Thu Oct 23, 2003 10:55 am Posts: 11 Hi all, It seems that I misundertood how the transparent persistent collection (managed by reachability) worked with Hibernate. Here is a sample configuration hbm file with a bidirectionnal Parent-Child relationship: Code: |
80. list collection forum.hibernate.orgHi, When Hibernate replaces Java's list object with it's own implementation upon a call to saveOrUpdate(), what may cause the new list be empty? What is happening to me is this. I have an object containing a List property. This property is mapped to a list collection: |
81. Sets, lists and N:M, 1:M etc - more documentation? forum.hibernate.org |
82. how to pass parameter list to the IN operator? forum.hibernate.orgOnly one problem with Expression.in - I have no idea how to use it in my context. I have Employees & Skills ... (yep, Gavin, you have already seen this - http://forum.hibernate.org/viewtopic.php?t=925086 ) And I need to find all employees who has ALL of requested skills. This query works fine: Criteria query = session.createCriteria(Employee.class) .add(Expression.sql( "( " + " SELECT COUNT(es.skill_id) ... |
83. add / remove in a Many-to-Many composited List forum.hibernate.org |
84. List using Calendar forum.hibernate.orgPublic List listUsers(Calendar dtInitial, Calendar dtFinal) { String queryText = "from User u where u.dtInclusion >= :dtInitial and u.dtInclusion >= :dtFinal"; Query query = sess.createQuery(queryText); query.setCalendar("dtInitial", dtInitial); query.setCalendar("dtFinal", dtFinal); return query.list() } |
85. Adding new object to lazy list not updates object's index? forum.hibernate.orgHi. I have those classes: Code: |
86. List diferences between 2.0.3 and 2.1 forum.hibernate.org |
87. Collections - One to Many - Using List forum.hibernate.orgI have a Parent and two children, with one to many relationship. I have defined the one to many relationships with set, everything works fine. But I want a list of children, so I tried with list. I get a error "Element "list" requires additional elements". When I looked at the documentation, I found that I need to add a index ... |
88. Updating list-like indices forum.hibernate.orgI have a collection which is a bag, however each item in the collection has a displayIndex much like an index in a list. Is is possible to write a statement in hql like "add 1 to every displayIndex that is greater than 17"? I know I can retrieve them and update them myself, but I'm worried about what will happen ... |
89. Cannot swap two elements in a list forum.hibernate.orgHi there, I would like to swap two elements in a list, but I'm not able to do it. Here is my code: Code: Session hibernateSession = sessionFactory.openSession( ); Transaction transaction = hibernateSession.beginTransaction( ); try { ... |
90. Can I bind a size=0 List in Expression.in? forum.hibernate.orgI used Criteria to create query like Criteria crit = session.createCriteria(XXX.class);. I had an in condition like crit.add(Expression.in("XXX", aaaList)); aaaList is a dynamic list and I found it works when aaaList.size > 0. But when aaaList.size = 0 that means I need not query with this condition, it throws Exception: java.lang.NegativeArraySizeException at java.lang.StringBuffer. |
91. list and joined-class forum.hibernate.orgHi, All I have a parent-children relationship. I am going to use list rather than set or other types of collection for the mapping. It seems that child class does not need a surrogate key as Hibernate will use parent id and index as composite primary key to identidy a child. My child is a super class for a group of ... |
92. Is there an Announcement mailing list? forum.hibernate.org |
93. difference between Bag and List forum.hibernate.orgI have 2 tables with bi-directional one-to-many relationship. When I retrieve the data from the parent table, I get the desired parent and child collection(List) data along with null values. Why is it returning null data. The problem was solved when I used Bag instead of List in my xml mapping. What is the difference between Bag and List? When is ... |
94. Session.find() returns List instead of Set. Why? forum.hibernate.orgDidn't find this by searching so hoping for some guidance here: Why does Session.find() return a java.util.List? Why not Set for example? Or Collection? My guess is that it is more important to support multiple identical objects rather than making a point that the results are not ordered. If all of my objects have unique identifiers, is it safe to just ... |
95. persistent directory listing forum.hibernate.org |
96. why codegenerator generate sortedSet instead of List for bag forum.hibernate.org |
97. HQL and bean with List forum.hibernate.org |
98. strange List.clear() behaviour forum.hibernate.orgOn a simple one-to-many mapping: Code: |
99. How to map list with primary/foreign key col names different forum.hibernate.orgHello, I have a text_value table with "chunked" text in a legacy database. The text table resembles the following: txt_id (collection identifier) txt_ord (ordinal index) txt_value (string field) In another table (tableA) that populates a class (classA) I have a field that references the string value in the text table: my_txt_id (foreign key to text_value table) table_a_id (primary key) I'd like ... |
100. Map of lists forum.hibernate.orgNot being able to do what I wanted out of the box made me go back and think further about what I wanted to do. I drew up my object model, drew the database structure I wanted to generate and it all made sense (okay there were a few torn up bits of paper here and there :)) but in the ... |