1. Parent child and list forum.hibernate.orgHibernate version: 3.2.4.sp1 Despite (or... in consequence of..) an accurate reading of on line documentation, the book of Christian Bauer and Gavin King (2nd edition) and a long long search in the forum, i can say that.. I've nothing understood. I'm in total confusion. I have to implement a large number of parent-child structures in a web application. I need the ... |
2. Map,List,Set forum.hibernate.org |
3. Auto relationship using a list forum.hibernate.orgHi, I have class with auto relationship represented by a list of childs in my class and represented by a parent foreign key in my database table. Is possible to do this? The informations had been saved in database but the parent foreign key and index columns are null. table: CREATE TABLE message ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START ... |
4. HowTo: Save list of objects forum.hibernate.org |
5. Confusion with |
6. Saving a List of ojbects forum.hibernate.orgHello, I have a Java List of 2500+ objects, is there a way to pass the List to Hibernate and have it save the entire List in 1 call, or do I have to loop through the List and save each object 1 at a time? I'm currently doing the loop but it takes a long time and am looking for ... |
7. Querying a child list of strings forum.hibernate.orgI have the following mapping. |
8. two lists with same entity forum.hibernate.orgEntity B has table TABLE_B and Entity A has table TABLE_A, TABLE_B has a FK to TABLE_A, so parent table has no FKs. Maybe a solution can be to subclass B as C and D and have lists of subclasses but it does not make sense to make subclass just for the sake of loading problem for me, any thoughts ? ... |
9. query given list of object ids from different classes forum.hibernate.orgI have a list of object ids - the ids are for objects that are instances of different classes, but they all inherit from AbstractElement. I want to get the AbstractElement.name property for each of these objects, but for performance reasons I do not want to iterate through the list, load the object, get the name property and put it in ... |
10. select new list( com.StudentList( studentAge ...any Problem? forum.hibernate.org |
11. Criteria.list() producing nothing on 2nd query forum.hibernate.orgNew to Hibernate and working with WSAD/Eclipse, mySQL, Tomcat, Hibernate latest version, l3po connection pooling. 1. First query works fine and produces expected result: Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); List l = new ArrayList(); try { l = session.createCriteria(Users.class) .add( Restrictions.eq("user_id", uid)) .add( Restrictions.eq("password", pw)) .list(); if (l.size() <= 0) return false; if (l.size() > 1) { System.out.println("System error"); return false; ... |
12. Undocumented null-padding of lists? forum.hibernate.orgHibernate version: Hibernate 3.2.3 Mapping documents: This is a fragment of themapping file for our Module class... Code: |
13. Question about list indexes, reordering and performance forum.hibernate.orgHi again, replying mostly to help if someone has similar needs and to ask if somebody has good point on doing things this way: After some thinking and a little bit of prototyping one way to do the wanted thing could be something like that: - Forget the automatic indexing & ordering with List and make the index column a normal ... |
14. IN keyword with list of Strings forum.hibernate.org |
15. ManyToMany: list with duplicates, doesn't update collection forum.hibernate.orgHibernate version - 3.2.1 Database - mySql 5 Application.java @Entity @Table(name = "applications") private Set |
16. Map |
17. retrieving a list of specific type on table-per-hierarchy forum.hibernate.orgI have a legacy table that resembles table-per-hierarchy. I can map different subclasses to that table using @Inheritance(strategy = InheritanceType.SINGLE_TABLE) and @DiscriminatorColumn. However I want to map one-to-many association to this table but only return a list of a specific class. Is this possible? Below is an example of what I'm trying to do. Unfortunately, the database schema is production schema, ... |
18. Usage of parameter list in named sql-query forum.hibernate.orgHi All, I am facing some issue in dealing with named sql query. Im pasting the following query. |
19. Delete from uni-directional List forum.hibernate.orgWe have spent two days reading documentation, consulting experts, searching the web, etc. on a Hibernate issue that seems very, very obvious, to no avial. Any help will be appreciated. We are using Hibernate (3.2.1.ga) with annotations (also 3.2.1.ga). We have two persistent classes, called "Survey" and "Page". Each survey consists of a list of pages, and each page consists of ... |
20. query.List() returning strange results for a joined subclass forum.hibernate.orgNewbie Joined: Mon Apr 03, 2006 5:12 pm Posts: 15 Location: Glasgow, Scotland Hibernate 1.2.0.4000 I have the following mapping where the Event object includes a joined subclass TrainingEvent: Code: |
21. How to map lists that have lists inside of them ? forum.hibernate.orgHibernate version: 3.2 Mapping documents: Athlete, TrainProgram, Exercise My problem is that I have to map classes that have Lists inside of them and I don't know how to do it. For example: Code: ClassA{ List classB } ClassB{ List classC } ClassC{ *not anymore* } ClassA.hbm.xml Code: |
22. Is bidirectional list association possible? forum.hibernate.orgNewbie Joined: Fri Sep 07, 2007 4:53 am Posts: 2 Hi, I've been struggling with getting bidirectional list associations working and am now wondering if they are even possible. My copy of hibernate in action (probably out of date) says that such an association is not possible but this page on the hibernate site says that it is supported in hibernate3 ... |
23. Ordered List forum.hibernate.org |
24. Persistence API package-list forum.hibernate.org |
25. Query result list of 1 NULL object ?? forum.hibernate.orgNewbie Joined: Wed Sep 12, 2007 10:18 am Posts: 1 Location: Quebec Hi everyone, I have a problem with a query. I have a criteria which return a list of one object (in this case) but this object is Null. I dont understand what is the problem so I need your help. Here is my java code : Code: Criteria criteria ... |
26. [Resolved] Unwanted updates when retrieving list of objects forum.hibernate.orgAuthor Message henryju Post subject: [Resolved] Unwanted updates when retrieving list of objects Posted: Tue Sep 18, 2007 11:41 am Newbie Joined: Tue Sep 18, 2007 11:24 am Posts: 9 Hi all, I'm using Hibernate + Spring and I want to get a list of all objects from a table. It works fine, but after I took a look ... |
27. OrderBy annotation and persisting a list forum.hibernate.orgHi Akemi, As far as I know OrderBy does NOT guarantee the order in which elements are saved, but only the sequence in which elements are loaded. This is translated into an orderby clause in the select query. In reality the ordering will be the same because when an A entity is saved, the cascade feature will iteratate over all B's ... |
28. many to one mapping list problem forum.hibernate.orgHi, I have small problem with list/save/persist operations in 1:n mapping. I have 1:n mapping between Item and Attribute classes. Item.hbm.xml Code: |
29. How to map a HashMap containing a List forum.hibernate.orgHibernate Version : 3.1.3 I am looking for a way to map HashMap> as a property. The classes looks something like: class A { } class B { ... private C ref; private A keyProperty; ... } class C { ... private HashMap> map; ... } Since the relationship in C's mapping file is, inverse="true", linking tables are not ... |
30. mapping trouble with |
31. hibernate mapping for a buddy list forum.hibernate.org |
32. List |
33. List's "key Column" and "List Index" = n forum.hibernate.orgHibernate version: 3.x Mapping documents: |
34. two child lists of the same type forum.hibernate.orgI have one parent class which must keep two child lists, both are of the same class. // parent public class CustomTable { private List |
35. convert a list into resultset forum.hibernate.org |
36. SQL Collation conflict on list sizing in HQL -class hierachy forum.hibernate.orgHibernate version: 3 Mapping documents: See below Full stack trace of any exception that occurs: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select siebelserv0_.SR_NUMBER as SR1_121_ ......where siebelserv0_.SR_PR_ORG_NAME=? and (select count(surveys1_.case_ref) from ( select Q14, case_ref, 1 as clazz_ from dbSurvey.dbo.tbl__ResultsItServiceDeskSurvey ) surveys1_ where siebelserv0_.SR_NUMBER=surveys1_.case_ref)>0]; SQL state [S1000]; error code [446]; Cannot resolve collation conflict for equal to ... |
37. How to use discriminator on a list forum.hibernate.orgHi, I want to create an object that holds two lists; the lists are holding the same object type and they are being filtered according to an id. For example: I have one class called Person which is connect to one table. The members of the Person class are id,name and sex. Now I want to create a new object (Lets ... |
38. How to use discriminator on a list forum.hibernate.orgHi, I want to create an object that holds two lists; the lists are holding the same object type and they are being filtered according to an id. For example: I have one class called Person which is connect to one table. The members of the Person class are id,name and sex. Now I want to create a new object (Lets ... |
39. How to use discriminator on a list forum.hibernate.org[quote] Hi, I want to create an object that holds two lists; the lists are holding the same object type and they are being filtered according to an id. For example: I have one class called Person which is connect to one table. The members of the Person class are id,name and sex. Now I want to create a new object ... |
40. How to use discriminator on a list forum.hibernate.orgHi, I want to create an object that holds two lists; the lists are holding the same object type and they are being filtered according to an id. For example: I have one class called Person which is connect to one table. The members of the Person class are id,name and sex. Now I want to create a new object (Lets ... |
41. How save child list for new object without update? forum.hibernate.orgHello All, I create bidirectional associations, simular to paragraph "6.3.3. Bidirectional associations with indexed collections" from "Hibernate Reference Documentation", (and http://www.hibernate.org/116.html#A12 ) As collection I use list. I add to parent object one child object. When save new parent object, child object inserted, and after that updated. Question: How I can remove update for child after saving new parent object, or ... |
42. Parameterized query and empty list parameter forum.hibernate.orgselect entity.key from Entity entity ... |
43. returning list of objects as a Map forum.hibernate.orgHi, I have this entity: @Entity @Table(name = "country") public class Country { private String iso; private String name; @Id @Column(length=2) // getter/setters } Now I'd like the list of this table to return as a Map: return (Map |
44. Formulate query for WHERE IN LIST forum.hibernate.org |
45. Mapping java.util.List forum.hibernate.orgHello All, I am relatively new to Hibernate and hence this question. I have a java class that contains elements of the type java.util.List. public class Application extends DataObject { private List investments = null; public List getInvestments() { return investments; } public void setInvestments(List investments) { this.investments = investments; } } I am creating the Hibernate mapping file. How do ... |
46. list index without column, but only the resultOrder forum.hibernate.orgMy datastructure itself doesn't need a resultOrder, so a Set is suitable. But for showing new added items in a jTree I would need something like a List, because with a Set the whole tree gets mixed up after inserting new objects. And it is more intuitive to see new added items at the begining or at the end of a ... |
47. list sorted by list-index ? forum.hibernate.org |
48. Saving a list of objects forum.hibernate.orgIt is normal to get a sequence of inserts to add multiple rows to a table. SQL doesn't have a multiple-row-insert construct. The only shortcut to multiple inserts is a database "load" command, which ofen requires the whole database (or the set of related tables) to be put in a special standalone state. It's only meant for an initial load. |
49. Delete an item from a List forum.hibernate.org final Transaction tx = session.beginTransaction(); final WidgetContainer theContainer = (WidgetContainer)session.get(WidgetContainer.class, containerId); assertNotNull(theContainer); final Widget widget2 = theContainer.getWidgets().get(1); final List |
50. Indexed lists with no desirable null values forum.hibernate.org... //there is a one-to-many relationship between A and B |
51. Exlcuding an item from a list in mappings forum.hibernate.org |
52. HQL: How to check if an object contains all the ids in list forum.hibernate.orgHibernate version:3.2 Hi, I am trying to write a named query where the query should return list of objects which contain all the ids in the passed parameterList. I am new to SQL and HQL, so i could not find a right way to do this. Please help, here is the situation: Object A and B have many to many relationship. ... |
53. Newbie: Wierd behavior in one-many List forum.hibernate.orgIam new to hibernate and having a strange problem with bidirectional one-to-many relationship. Iam using a List and the size of the list is huge, all the elements in the list are null except for list[size-1] - this index has the actual row that I want. Hibernate version is 3 and Oracle 9i is the DB Here is my mapping: Parent ... |
54. Map with list as value forum.hibernate.org |
55. query with a list as example? forum.hibernate.orgHibernate 2.1 / Oracle10g I have a simple mapping that contains a list: Code: |
56. filtering with a list of ids forum.hibernate.org |
57. List of a class from a library forum.hibernate.org |
58. list-index versus natural-id - fight! forum.hibernate.org |
59. Adding to large Lists quickly? forum.hibernate.orgI have a List of persisted entities which will grow very large (perhaps 10000 elements) over time. Most of the time I will be accessing this List simply to add another entity using List.add(Object). When doing this Hibernate loads the entire List (even with lazy fetching), although strictly speaking you could persist the added entries just by knowing the size of ... |
60. List/Map indexes w/ Many-to-Many ... HELP! :) forum.hibernate.orgAll, I am using Hibernate and the Google Web Toolkit together using a package called Hibernate4GWT. I have it working, to an extent, and I like it VERY MUCH. :) My problem is that I am trying to populate a List field with a many-to-many association, but I am failing to understand from the documentation how to do this. According to ... |
61. Using like clause with list of string objects forum.hibernate.orgWe have problem where we need to use like clause for array of strings e.g name select * from xyz where name like '%ABC%'; Now here values will come in form of String Arrays do we tried using String[] a_Name; has some values l_Query.setParameterList("Name",a_Name) we tried using select r1 from xyz r1 where r1.Name like :Name & select r1 from xyz ... |
62. One to many mapping using List and index column forum.hibernate.orgHello, I need to have a one to many relation between the PARENTS - CHILDS tables; and need the parent the loaded childrens in an indexed collection, so I preserve the order by index. The problem I have: When I persist the parent, it seems fine, excepting the fact that on the CHILDS table I see an extra UPDATE that populates ... |
63. getting list data; sorting and unexpected null forum.hibernate.orgI have a number of mapping collection problems when trying to load data from two tables. The table structure is a simple top level table with a referenced list of locations in the second table. 1a. When I try to automatically load from the table using a list (see locationList below) it returns null as the first item in the list. ... |
64. Constructing with list: select new X((select new Y(...))) forum.hibernate.orgI'm trying to get historical balances on an account, and to do that I thought maybe I could ask hibernate to calculate those historical amounts and then construct an Account object with the historical balances but the rest of the account object intact - a kind of "group by" that puts the grouped row data into a list instead of aggregating ... |
65. Criteria query: Restriction on a specific element in a list forum.hibernate.org |
66. A remove from list problem forum.hibernate.orgHello I Have a Object with a List, the mapping: Code: @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "XXX") @IndexColumn(name = "ORDERNUMBER", base = 0) public List |
67. Using List in HQL WHERE clause forum.hibernate.orgSame deal. expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)] org.springframework.orm.hibernate3.HibernateQueryException: ... |
68. one-to-many indexed List not working forum.hibernate.orgNewbie Joined: Tue Feb 19, 2008 11:42 am Posts: 2 Hibernate version:3.2.1 Name and version of the database you are using:Oracle 10G Mapping documents: Code: |
69. Listing many to many database relationship forum.hibernate.orgHi! I have a many to many relation into my database between the tables Category and Content. Category -> CategoryContent <- Content In the table CategoryContent I just jave have the id's from both Category and Content table. My question is: How can I get the list of all Contents if I know the Category id? public Set |
70. Listing many to many database relationship forum.hibernate.orgHi! I have a many to many relation into my database between the tables Category and Content. Category -> CategoryContent <- Content In the table CategoryContent I just jave have the id's from both Category and Content table. My question is: How can I get the list of all Contents if I know the Category id? public Set |
71. How to compare Map in a List? forum.hibernate.org@Entity @Table(name="mytable") public class Element{ @JoinTable( name="map_table" ) @CollectionOfElements(fetch=FetchType.EAGER) @Cascade(value = CascadeType.DELETE_ORPHAN) @Enumerated(value=EnumType.ORDINAL) @MapKey( columns = { @Column( name="myenum" ) } ) @Column( name="myvalue") Map |
72. how to map a map that contains lists as values forum.hibernate.org |
73. How to print created tables list in logs forum.hibernate.orgHi, I crated around 27 tables and these are working fine. I want to print created table names in logs. How can i do this. I tried with calling execute(true,true,false,true) method of SchemaExport Class. But queries to database is printed in logs. I want to print only info to user like "Table created XXX " after creation of every table by ... |
74. NPE when calling query.list forum.hibernate.orgI just verified that this only happends when using the second-level cache. Sequence to reproduce: 1. Run query "from Customer" 2. Add an entry to Customer#products collection 3. Run query "from Customer" => nullpointerexception in query.list() This happends everytime, but only with second-level cache (OSCache). It should be noted that there is extensive use of "property-ref" relations, even in collections. Could ... |
75. How to create a map which contain each element as a list forum.hibernate.orgI need to create a list of map. i.e a map which contain each element as a list. My problem is listed below. I have a ListMaster each ListMaster is subdivide into sub-list and sub-list is classified as different type. My table structure is LIST_MASTER Code: LIST_ID(P) LIST_NAME L1 ... |
76. Query a list attribute with hql forum.hibernate.orgHello. I am pretty new to Hibernate and have some problems with a HQL query. I have persisted some objects, which have a structure like this: class Document: long id List |
77. List table fields forum.hibernate.orgHi all, I'm using Hibernate 3.1on DB2 express edition. I have the necessity to get the fields of a table. I thought that java-reflection could help me but because of Hibernate mapping (e.g foreign key are mapped with classes) I couldn't retrieve fields name from the table. If someone is able to help me I would appreciate it. Thanks in advance. ... |
78. Mapping a List forum.hibernate.orgI think something is wrong with my list of url in the class item. When persisting it locks after inserting into the url table.No exception or anything. If i remove the list from the mapping it works. Hibernate version: 3 Mapping documents: Item: |
79. list-index sorting issue forum.hibernate.org |
80. change parent in bidirectional list association forum.hibernate.orgHi, I have a bidirectional parent child relation with an indexed collection. My mapping is as follows: Code: |
81. Confused in one-to-many mapping with |
82. How to retrieve the list-index element in a list collection? forum.hibernate.orgI am using a LIST to map Images to Items. I am using imageid column as my list index element. However the imageid is null when I retrieve Items and their Images. How do should I change the mapping to fix that? item { itemid, itemname } image { itemid, imageid, imagetitle } Please help! Hibernate version: 3.2 Mapping documents: Code: ... |
83. How to retrieve the list-index element in a list collection? forum.hibernate.orgI am using a LIST to map Images to Items. I am using imageid column as my list index element. However the imageid is null when I retrieve Items and their Images. How do should I change the mapping to fix that? item { itemid, itemname } image { itemid, imageid, imagetitle } Please help! Hibernate version: 3.2 Mapping documents: Code: ... |
84. Secon read over criteria.list() method with old data forum.hibernate.orgHibernate version:3.X If I read data over the method session.createCriteria(BusinessObject.class).list I got the right data. I update the data over a other session. If I read the data again over the first session I got the old data. Some other Hibernate user have the same problem. But all solutions which are described will not solve the problem. So I have debug ... |
85. Quey.list cause memory leak (OutOfMemoryError) forum.hibernate.orgHi, I run a client program that load each iterate 300 hibernate objects using Query.list(). Unfortunatly, after a while, I got OutOfMemoryError. I ran it many times and it always fails after around 2400 iterations. I watched it through JProfiler and I saw that the used heap size growes significantly during this time and the GC couldn't release enough memory. I ... |
86. UPdating A List With Set As IndexColumn forum.hibernate.orgHi all, I was just wonder if someone could tell me if I am doing this right. I've got a object defined like below: Code: @Entity @Table(name = "STORE") public class Store { @OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = "STORE_ID", nullable = false, updatable = false) @org.hibernate.annotations.ForeignKey(name = "FK_FIELD_STORE_ID") @org.hibernate.annotations.IndexColumn(name = "FIELD_POSITION", nullable = ... |
87. criteria.list() causes session to be dirtied forum.hibernate.orgHibernate version: 3.2.6.ga I have a Criteria query with the following code: ... Logger.info(this, " dirty session? " + this.getSession().isDirty()); List |
88. afterOperation call in SessionImpl.list() method forum.hibernate.orgCan some one explain the purpose of afterOpration() call in the finally block of SessionImpl.list() method. This inturn calls StatefulPersistenceContext and sets the lockMode to NONE for all the entities from that Query. I am using ehcache, is this check still required even for the resultset returned from ehcache. Looks like this is something that got introduced in 3.x as this ... |
89. Save object that contains a list of objects to be also saved forum.hibernate.orgHi all, I am not sure whether this issue is normal or not. The thing is have an object, let's say: Company that has a list of objects, let's say a list of Employee. Each Employee object has an attribute that is a reference to the Company. It would be something like: Company { Set |
90. Why does createQuery(hqlQuery).list() return Object[]?? forum.hibernate.org |
91. Memory Consumption of list() vs. List with ScrollableResult forum.hibernate.orgAuthor Message Allesmallachen Post subject: Memory Consumption of list() vs. List with ScrollableResult Posted: Fri May 30, 2008 5:43 am Newbie Joined: Sun Dec 30, 2007 1:08 pm Posts: 12 Hi, I've written a small test to measure the memory consumption of my Hibernate code. It seem that getting a List of objects with the list() method of a ... |
92. List question forum.hibernate.orgHello, I am looking for suggestions on what is the best way to implement a hibernate collection. I have a column called" "SeqNBR" which indicates the location of the element in the collection. An element in the collection is allowed to move from its position. My application needs that flexibility. If I use the traditional ArrayList to implement this I could ... |
93. Problem with hibernate session.createQuery().list() forum.hibernate.orgI have an application running on tomcat 5.5. It uses struts, tiles, hibernate and MySql 5.0 as backend. PROBLEM: Fresh Data is inserted into a table in MySql through hibernate APIs. Immediately after the insertion, when the table is queried, fresh data never shows up, until arroximately 10 seconds or so. Details: ===== 1. Data is inserted as mentined below. Session ... |
94. Fully-qualified list of objects from Criteria forum.hibernate.orgI'm using Hibernate 3.2.2 and trying to retrieve a fully-qualified list of objects from the criteria.list(). Objects are always returning unqualified. This is required for my application in order to avoid another layer of transformation (hence performance). I wonder if there is any setting i miss in the class mapping file (hbm), or the hibernate configurations. I'm also working with nHibernate ... |
95. Is there a way to map idexed list with duplicates? forum.hibernate.org |
96. Problem with Criteria.list() forum.hibernate.orgHi, I am trying to fetch all entities from the database, filtered by a given entity A which is in a many-to-one relationship with another entity B. The problem is in the select statement generated by Hibernate. In the WHERE clause, only the fields from entity A appear, not the ones from the joined entity B. So if I change the ... |
97. Quey.list cause memory leak (OutOfMemoryError) forum.hibernate.orgHi, My problem doesn't solved. I run a client program that load each iterate 300 hibernate objects using Query.list(). Unfortunatly, after a while, I got OutOfMemoryError. I ran it many times and it always fails after around 2400 iterations. I watched it through JProfiler and I saw that the used heap size growes significantly during this time and the GC couldn't ... |
98. Can not return the list page forum.hibernate.orgthe saveCustomer in Dao impl is: public boolean saveCustomer(TblCustomerInfo customerInfo) { getHibernateTemplate().save(customerInfo); return true; } and the applicationContext.xml related the transaction setting is: |
99. delet list of keys forum.hibernate.orgHi, you can use this; I am not sure if you key is a composite key. Try this String hqlDelete = "delete Item i where i.id = :ids"; int deletedEntities = session.createQuery( hqlDelete ).setParameterList("ids", keys).executeUpdate(); where keys is a list of your keys. What is the type of your composite key? Hope this help |
100. Unknown entity with Criteria.scroll(), but not .list() forum.hibernate.org |