List 6 « Map « JPA Q&A





1. problem in crit.list();    forum.hibernate.org

There is an exception occur when run crit.list();: I copy sql to sqlplus, it works well. So I guess the problem is set database field value to class. I reviewed the record in database and not found null value in Numeric field. I used h2.0.3 java.lang.ClassCastException at net.sf.hibernate.type.DoubleType.set(DoubleType.java:24) at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46) at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31) at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:494) at net.sf.hibernate.loader.Loader.doFind(Loader.java:136) at net.sf.hibernate.loader.Loader.find(Loader.java:620) at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:81) at ...

2. Mapping a List : collection index problem    forum.hibernate.org

Hi, I have a parent child relationship 1 Allocation -> Many AllocationDays mapped as a List with dayOfWeek column in the table AllocationDays as the index column for sorting the list. extract from the Allocation.hbm.xml : ------------------------------------------- I create a new Allocation and add allocationDays to ...

3. List collections in inheritance    forum.hibernate.org

Can i use List Collections in joined-subclasses ? Something like: Hibernate throws the following Exception 18:15:48,668 INFO Configuration:300 - Mapping resource: Productos/ElementoEditorial.hbm.xml 18:15:48,758 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(18) Element "list" does not allow "one-to-many" here. 18:15:48,788 ERROR XMLHelper:48 ...

4. List collections without indexed columns    forum.hibernate.org

Is it possible to map ,in a subclass, a list collection if the table has no indexes. Is it possible to use the primary key like an index? I ve read in the reference something about idbags,but i cant understand how do they work. The xml looks like this

5. mapping lists    forum.hibernate.org

Ok ,i have a bidirectional relation and i must use a list collection because we 've already implemented the methods to work with them ,the structure of the table is this Product; p_idprod p_descr Suplement: p_idsupl F_idProd Does exist a way to map these tables using a list collection,or i must use another collection. I must mention that both classes inherited ...

6. Object arrays from list    forum.hibernate.org

Assume I have a dead simple hibernate object with two fields, ID and Name, ID being an int primary key, Name a string. I run a query to get all the rows in the table, and use toArray() function of list to return all the objects, modify one of them and flush the session. Presumably hibernate has no way of knowing ...

7. How to save List of List data?    forum.hibernate.org

8. How to map in a List?    forum.hibernate.org

Hi, I'm not quite sure if I understand your problem - what do you mean by redundant data? If you are trying to share Nodes between A's where one Node can belong to many A's and an A can have any Node(s), aren't you after a many-to-many mapping? i.e. Node *---------* A

9. Session.find() returning empty list    forum.hibernate.org

Using Hibernate 2.1.1 and Oracle 8.1 Session.find() is returning an empty list. The code I am using is: Transaction tx = session.beginTransaction(); List leavingReasons = session.find("from LeavingReason as leavingReason order by leavingReason.id"); // leavingReasons is empty here The Log shows correctly generated SQL: select leavingrea0_.ID as ID, leavingrea0_.name as name, leavingrea0_.description as descript3_, leavingrea0_.valid as valid from Leaving_Reasons leavingrea0_ order by ...





10. One-to-Many-to-Many with Lists    forum.hibernate.org

Hi, I have a case that could be described as follows: Object A has a List of B's. Each B has a List of C's. I cannot successfully map the entire relationship. I have been able to do map and persist the A-to-B relationship by including a , , and in A's area. To map the B-to-C relationship, ...

11. Get owner list of a list item    forum.hibernate.org

I'm trying to figure out how to find out what is the owner list of a list item. My list mapping is: Code: /** * @return m_listItems * @hibernate.list * lazy="true" * cascade="all" * @hibernate.collection-key * column="ListId" ...

12. parent/child using list????    forum.hibernate.org

Hi guys! I have a tree structure table and use the composite pattern ........................... ............................ and its working fine. I'm displaying it as a tree in jsp( using javascript). My problem is this i want my data to be displays all the nodes that have children ...

13. Can you use Lists inside a subclass    forum.hibernate.org

I have a list inside a subclass mapped as follow: Code:

15.  vs mapping    forum.hibernate.org

16. cache a reference list    forum.hibernate.org

I have a few reference data list (read only data most of the time) want to cache. It seems if I user session.iterate, Hibernate still go to DB to get the key of the list. Is that possible that to cache a reference list by using hibernate.hbm.xml and never go to db to get the list unless the cache time out? ...





17. List index values being set to all zeros    forum.hibernate.org

I have an indexed one-to-many mapping. I add four children and save(), and the indices are 0..3 in the database. When the next child is added, for some reason the first four indices get set to zero, and the last one set to 4 (so now I have 0, 0, 0, 0, 4 in the database). Obviously a problem. My (simplified) ...

18. HQL Using Lists as parameters    forum.hibernate.org

Hello everyone, I need some help with HQL. I have and object X and it has a list of Ys and the Y object as an attribute Id. I pass to the where clause a list of Ids and I need a list of all my X's where any of its Y's has either one or more Ids I passed. Just ...

19. 1 to many with list gives me OutOfMemory    forum.hibernate.org

Beginner Joined: Mon Feb 09, 2004 3:06 pm Posts: 26 Location: Tampa, FL I'm attempting to map a 1 to many using a List to contain the many end of my relationship. When I callthe session.load(), the CPU churns for a bit and I then get an OutOfMemory exception. It appears that don't have something mapped correctly, but I'm not sure ...

20. Index column for LIST mapping is always NULL    forum.hibernate.org

Hi, I have the problem, that when mapping a one-to-many association using a list the index column I specified is always null. Actually when I watch the SQL statement getting executed the insert statement does not contain the index column. My mapping looks like this: Code:

21. List Collection question wrt to null/empty children    forum.hibernate.org

I have come across this problem of not being able to load/find a Parent from the database that has basically a 'null/empty' Child collection. My mapping from Parent->Child is a non-lazy uni-directional List collection ( I have read in the doco that Hibernate does not support bi-directional Lists ), with cascade="all-delete-orphan" set on it. When my Parent instance has a non-null ...

22. criteria.list() in flushDirty()    forum.hibernate.org

Here's my situation. I have a bunch of persisted objects. When flushDirty() is called on any of them, I do some work (e.g. send an email), but only if a certain value is set to true for the current transaction. I decided to store that value in an object that I persist with Hibernate. In the flushDirty(), query for the object ...

23. Querying a list, elements are not sorted by index    forum.hibernate.org

Heya, A Session has a list (many-to-many) of Publications. Given a Session, I want to get a subset of its Publications. However, the Publications are never sorted. I can see in the generated SQL that no "order by" clause is generated. Am i wrong to assume Hibernate should sort it ? Is there a way to use the index defined in ...

24. newbie + mapping lists of objects = help    forum.hibernate.org

As the title subject says, I need help with mapping lists. I have an object that has in it a list of many other objects. I have read ch 5 and ch 6 of the tutorial many times, but nothing I find seems to clarify the problem any more. Can someone write me a quick mock up of how to map ...

25. Possible to retrieve a list of column names?    forum.hibernate.org

26. Why createQuery.list work, but .iterator does not...    forum.hibernate.org

Author Message apauna Post subject: Why createQuery.list work, but .iterator does not... Posted: Fri Mar 12, 2004 6:17 pm Newbie Joined: Mon Nov 10, 2003 2:48 am Posts: 8 Location: GE Medical Systems Hello, I am attempting the following: Code: SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); part.setParticipantname("ACCSF"); //sess.createQuery("select ...

27. First element of List is null, why ?    forum.hibernate.org

28. How to order a list of objects by date?    forum.hibernate.org

Hi I have an class that has an attribute that is a list that should contain a collection of objects order by a specific date property in that object. I'm using Hibernate 2.1 and JDK 1.3 so I cannot use the order-by property in the mapping file. Is there another way to bring the list ordered?. Thanks in advance

29. List as query parameter.    forum.hibernate.org

30. Index column ignored when saving java.util.List property    forum.hibernate.org

Emmanuel, thanks for the info. Meanwhile, I have found the relevant FAQ entry. Anyway, I switched to typed arrays instead of lists since my domain objects are exposed via webservices. But now ist seems as if Hibernate doesn't support cascade="all-delete-orphan" when using arrays? The docs didn't say anything to this effect, so I might be wrong. Cheers, Olaf

31. Avoiding activation of huge lazy lists on add()    forum.hibernate.org

Is it possible (in the most recent release of hibernate) to add() to a lazy list without loading the whole thing into memory? I am trying to code for a situation in which the total length of the list could vastly exceed available memory. I know I can keep it out of memory for reading by using session.filter() but I need ...

32. Null values in many-to-many list    forum.hibernate.org

33. Many-to-many with one list in each class    forum.hibernate.org

Hi all, Hibernate 2.1.1 on servlet on JonAS 3.3.5 I have already tried to look for answers in this forum and the FAQ, but I can't figure out how I have to proceed. I have two classes Group and User. In Group I have a list of users and in User I have a list of the groups where the user ...

34. hibernate 2.1.2 jboss 3.2.3 - List class not found problem    forum.hibernate.org

jpratt Post subject: Posted: Thu Apr 08, 2004 11:52 pm Beginner Joined: Tue Dec 30, 2003 1:51 pm Posts: 49 Location: Michigan, USA Here is the output. Code: 2004-04-08 23:46:37,906 WARN [org.jboss.system.ServiceController] Problem starting service jboss.jca:service=iMarketplaceHibernate java.lang.IllegalAccessError at net.sf.cglib.core.ClassEmitter.setTarget(ClassEmitter.java:87) at net.sf.cglib.core.ClassEmitter.(ClassEmitter.java:79) at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:197) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:63) ...

35. Criteria.list method is not working...    forum.hibernate.org

I have the following method in my class: public List list(Properties criteria) throws PersistenceException { if(criteria == null) { return null; } Session session = null; try { session = sessFactory.openSession(); Criteria crit = session.createCriteria(EditTrailPersistenceManager.class); Iterator iter = criteria.keySet().iterator(); while(iter.hasNext()) { String fieldName = (String)iter.next(); String value = criteria.getProperty(fieldName); System.out.println(fieldName + "---" + value); if(fieldName.equalsIgnoreCase("id")) { crit.add( Expression.eq("id", new Long(value)) ); ...

36. query in a list of String    forum.hibernate.org

thank you. But i'd like to do this using hql or criterias. My db doesn't support subquery. My domain class is like class A { private Long id; private List labelList; // list of String // getters and setters // ...... } I want to retrieve all A instance that has "coucou" in its labelList.

37. validating on object present in List    forum.hibernate.org

Hi All! I am having Company and Category table with many to many relationship. In my company table I am having companyID and in Category table I have categoryID. I have one transection table named company_category_relationship in which relationship enteries are being made. Mapping from database to class is proper. General HQL queries are getting fired properly. Now the problem: In ...

38. using multiple SessionFactories to copy list of objects    forum.hibernate.org

hi, I'm trying to copy some objects from one database to another using two different SessionFactory objects. From reading the documentation, it seems to me that the following should work: Configure two different session factories, then 1) get a session from the first; get objects from this session (returns a List); close the session. 2) (without making any changes to anything) ...

39. Map a List to individual columns?    forum.hibernate.org

I was wondering if it is possible to map a Java List to individual columns in a database table. For example, a Java bean has an 'emails' property as a List, but the database table only has single 'email' and 'alt_email' fields. Is there a way to do this? I've looked a bit into using a Custom value type, and this ...

40. Calling size() on List causes multiple SELECTs    forum.hibernate.org

Hello, I have Hibernate queries returning Lists of my POJOs from DB. I would like to check the size of the returned List, so I can use it for "showing XXX matches" messages in my application. I can call size() on returned Lists and get that count, but that causes Hibernate to load each POJO by running a separate SELECT for ...

41. Query a list based on the index field    forum.hibernate.org

I believe what I want to do is not possible, I just wanted to confirm... I have a parent child relationship (Test/Question) using a List. As the user takes the test online I display each question on it's own screen. When a question is answered, I query for the Test and get the next Question using List.get(index). I was trying to ...

42. Removal from a list    forum.hibernate.org

I have a class with a ordered list of children. I've mapped this as a list in the mapping descriptor. Everything works as I'd expect it to except that if I check what happens when a child is removed from the list I find that it first sets the parent and pos of every child in the list to null and ...

43. [Struts] get list of companies and save user    forum.hibernate.org

I'm currently working on a user management system with struts, hibernate and mysql. I'm new to Hibernate, but what I want to do is the following: When the administrator is creating a user, he has to select the company of the user from a combobox in the userform. I've two tables: useraccount and company So, the user has to be saved ...

44. Ibag List examples needed    forum.hibernate.org

45. A way to return list of myObject instead of list of Object[]    forum.hibernate.org

When doing query = session.createQuery("Select a.name,a.adress from myObject a"); List myList= query.list(); I will get a list of Obect[] objects, and not a list of myObject's. Is there a way to make hibernate return a list of myObject , when I choose not to select all of the fields? Or must I manually iterate over the list that is beeing returned, ...

46. How do I list out a select query with several columns??    forum.hibernate.org

Pretty new at Hibernate and right now I have create a testdatabase. Want to list out a select query containing several columns. One column works fine but how do I program to list out the answer with several columns? This is my query & how the answer gets into an iterator: Query q = session.createQuery("SELECT co.countryCode, st.storeNo FROM net.sf.hibernate.Country co, net.sf.hibernate.Store ...

47. outer-join fetch on list?    forum.hibernate.org

Could it be that outer-join fetches are not supported on lists? I am using a construct like but the association is still fetched in a seperate SQL statement. I am using the MySQLDialect with MySQL 4.0.18 and Hibernate 2.1.3. Here are my ...

48. SortedSet vs List    forum.hibernate.org

Hi everyone, i'm trying to order elements of a one-to-many relation say So I currently have a sorted set. the problem is that I create to many engagement at once and they all have the same date. So many are not included in the TreeSet(). Moreover ...

49. How to list out orderlines from orders?    forum.hibernate.org

I'm lost. I have a one-to-many relation between Order and Orderline. In other words I wan to list out many orderlines to one order. How do I do it in Java? OrderLine -******* private String articleNo; private String articleName; private int quantity; private int price; private int volume; private int weight; private int deliveryDate; Order -***** private Date createDate; private Date ...

50. scrolling through a list    forum.hibernate.org

Hi, What I am trying to do seems pretty simple and a straightforward implementation of the setMaxResults and setFirstResult API's. Below is the code I am using to retrieve a list. Once the list is retrieved I am creating a subset of the list to return to the user and I am using the setMaxResults & setFirstResult API. This works fine ...

51. Set distinctResult = new HashSet(criteria.list());    forum.hibernate.org

The problem is that TreeSet ordering is based on a Comparator. So you'd have to construct a Comparator that knows how to order the results in the manner in which they are ordered in the list. The easier approach would be to create a new collection impl that functions as both a List and a Set at the same time. I ...

52. Child List collection deletion woes    forum.hibernate.org

53. HQL, many-to-many lists and join    forum.hibernate.org

54. Multiple Objects in List (resultset)    forum.hibernate.org

Hi all, I feel pretty stupid asking this, as I know I've done it before and I'm sure I've read it here somewhere before...just that I can't seem to find it. (You know...one of those days) Anyway, I have an HQL query that returns 2 objects in the List, and I'm trying to remember how to extract each object from within ...

55. wrong order of list objects in HQL query    forum.hibernate.org

hi there, I am using 2.1.1 I use this mapping: Code: ... ...

56. Can Hibernate manage a map of lists?    forum.hibernate.org

58. Avoid listing all columns in SELECT clause    forum.hibernate.org

I have a couple of tables with large numbers of columns. Hibernate lists all the solumns in the target tables when converting HQL to SQL. I remember there was a way to force Hibernate just to use "select * from ..." instead of listing all the columns in the SELECT clause. How do I do this? Thanks. Alec

59. Removing an object is blocked by a reference to it in a list    forum.hibernate.org

Author Message paulcallahan Post subject: Removing an object is blocked by a reference to it in a list Posted: Wed Jun 16, 2004 1:55 pm Newbie Joined: Wed Jun 16, 2004 11:20 am Posts: 6 I get a referential integrity error when I try to delete an object that is also referred to in a many-to-many list mapping. Not ...

60. Large one-to many list    forum.hibernate.org

If you think on criteria.setMaxResults, it don't work with Oracle 8.0, but it isn't important. I know that I can resolve this problem,but I want that Hibernate work this (with declaration in mapping file) I don't know why You haven't request like this, but large query are often and I want next form Hibernate give me "normal" collection, but I want ...

61. Nested Object (Endless list)    forum.hibernate.org

Author Message denlindy Post subject: Nested Object (Endless list) Posted: Thu Jun 24, 2004 2:36 pm Newbie Joined: Thu Jun 24, 2004 1:21 pm Posts: 5 Location: Des Moines IA I am using version 2.1.1. I have been using Hibernate for about two months. This is not really a problem, just a question about the amount of data returned ...

62. List mapping has null entry at the beginning every time    forum.hibernate.org

I'm having a problem where a list mapping produces a null object at the beginning of the list. Here is the mapping: Code: ...

63. PK constraint violated when removing first item from list    forum.hibernate.org

We have a bidirectional many-to-many mapping with a list on one side and a set on the inverse side. I found that if I remove the first item from the list, the primary key uniqueness constraint is violated. Unfortunately, I don't have a debug log with me here (I'm at home right now). I'll give pseudocode for the SQL that was ...

64. The Use OF List    forum.hibernate.org

I see that we need to use List in order to have the index column... my question is, 1. AFAIK, index is used to speed up data retrieval....The index here, does it have the same purpose? 2. To implement index correctly, how do I implement the index? Do I insert a different value for each insert or does it have some ...

65. Mapping to a List index issue    forum.hibernate.org

Author Message rodgel Post subject: Mapping to a List index issue Posted: Thu Jul 01, 2004 1:01 pm Newbie Joined: Thu Jul 01, 2004 12:47 pm Posts: 1 We have a complext database and everything seems to be working fine except we have two tables, a Promotion Table and a AcademicProgram Table. We want the Promotion Table to map ...

67. list cascade="all-delete-orphan" does not work!    forum.hibernate.org

Hi, I have to classes VendorDateEntry and UserDateEntry that both extend a class DateEntry. I have a class EntryContainer that has a mixed list of VendorDateEntries and UserDateEntries. I want to use a table-per-concrete class strategy for VendorDateEntry and UserDateEntry. After a lot of trial an error I finally found a mapping that works, i.e. the database tables look the way ...

68. many-to-many lists    forum.hibernate.org

I've searched through the docs, but I can't figure out how to create a many-to-many list where the index is stored in the association table. I can store the index in the table that contains list elements, but this does not work so well for many-to-many lists. Does anyone have an example they could share which would show me how to ...

69. scroll() creates proxies, but list() doesn't?    forum.hibernate.org

Can someone explain why the objects that are returned from a ScrollableResults created with scroll() can be proxies, but the objects returned from list() cannot? I can create a list of proxy objects by taking each one from a scroll and adding it to a list, but this is slow, since there's usually network overhead each time you iterate through the ...

70. list ordering functionality    forum.hibernate.org

This is probably a silly question but so far but, it seems like I can only use integer fields for the index attribute of a list. How can I use a list with the ordering by a created_date... I would think it would be something like the following (which doesn't work): ...

72. My 1st List (session.find) query    forum.hibernate.org

Hello, I am having a lot of trouble making my first list query. I know hibernate is set up correctly because I can insert and get values from the db. My problems start when I use the session.find and session.createQuery. The simplest example I could find was session.find("from CLASSNAME"); where CLASSNAME is the name of my object. It seems the SQL ...

73. Criteria.List()    forum.hibernate.org

What does Criteria.list() return? A List, obviously, but is it a session dependent list? I need a detached List of objects, so I have this method: Code: public List getAll(Class c) throws HibernateException { Session session = HibernateUtil.currentSession(); Criteria crit = session.createCriteria(c); ...

74. NonUniqueObjectException occurs when saving a list    forum.hibernate.org

Hi, I am using Hibernate version 2.1.3 and I am having a problem when I try to add more than one object to a list and save it. There is no problem if I only add one BaseCodeListItem object to the list but when I create another object and add that to the list then do a saveOrUpdate I get a ...

75. Manipulating result list returned to the presentation layer?    forum.hibernate.org

Hey all, first time poster. I've been working with Hibernate for a short while now, and am at a point where I am trying to manipulate the query result list returned back to the presentation layer (JSPs). I am using the Criteria class and below is a simple example of what I want to accomplish. Quasi SQL: SELECT A, B FROM ...

76. Mapping list elements to separate fields on a database    forum.hibernate.org

I have the following setup: A class called Address that contains a String (post code) and a List (of address lines). On the database this is stored as a CHAR for the post code, and 5 separate address CHAR line fields (i.e addressLine1, addressLine2 etc). The database design is nothing to do with me and unfortunately I am stuck with it. ...

77. One-to-many list - foreign key and index not being filled    forum.hibernate.org

Author Message jyellis Post subject: One-to-many list - foreign key and index not being filled Posted: Tue Aug 10, 2004 5:10 pm Newbie Joined: Tue Aug 03, 2004 3:58 pm Posts: 2 Location: RTP, NC When I run the below code snippet, the two individuals object get saved, but the PARENT_ID and PARENT_POS do not get updated when the ...

78. Criteria:comparing list of associations    forum.hibernate.org

Hello, I am using the Criteria and Criterion framework to build a simple query. To explain my problem, here is an example: ProductGroup has a many to many association to Product. I want to build myself a query that will look if two ProductGroup are identical. Therefore, I need to know if the list of products of both are the same. ...

79. Criteria queries with user defined select list    forum.hibernate.org

We don't plan to spend any time improving Criteria API until the 3.1 timeframe, unless someone wants to really step up and take on the responsibility to "own" the Criteria stuff and put a lot of work into it. So far no-one has offered to do that. We have to prioritize things, and this got pushed back.

80. Application with multiple list    forum.hibernate.org

I have applications that allow users to page through multiple tables using a web front end and access to these tables is through stateless EJB's. I am assuming I need to use ScrollableResults and I need to keep the Session open when going back and forth to the web tier. When I want a new page from a previously displayed list, ...

81. Problem saving child list    forum.hibernate.org

Author Message sblundy Post subject: Problem saving child list Posted: Fri Aug 27, 2004 4:42 pm Newbie Joined: Tue Nov 11, 2003 2:27 pm Posts: 9 Ok, I've been at this one for a few days. It seems like it should be simple. I've read the documentation multiple times, to no avail and have tried many different combinations of ...

82. Modeling many to many relationship as a bidirectional list    forum.hibernate.org

Newbie Joined: Fri Aug 27, 2004 6:53 pm Posts: 4 Attached is the javabean code and the generated schema. Please look at how in the generated schema, the primary key is the combination of just the BAR_ID and BAR_IDX. How do I get the primary key to be FOO_ID, BAR_ID and BAR_IDX? I may be totally off track here in defining ...

83. Duplicate Key when updating many to many list.    forum.hibernate.org

Author Message rezdog Post subject: Duplicate Key when updating many to many list. Posted: Wed Sep 01, 2004 6:54 pm Newbie Joined: Wed Jan 21, 2004 5:12 pm Posts: 8 It took me a couple days to track this down. But it looks like whenever you load up an object related to another object in a many to many ...

84. List u = q.list() doesnt get executed    forum.hibernate.org

Regular Joined: Sat May 29, 2004 2:16 pm Posts: 81 Hibernate version: 2.1 Mapping documents:

86. Bidirectional one-to-many re-sorting the indexed List    forum.hibernate.org

Hibernate version:2.16 Hi there, I've got myself a parent object called Property which contains a List of PropertyImages. Everything works a treat and is working fine. Now the thing is this. I want my users to be able to move PropertyImages up and down the index. If an image is at 0 it will be the first image displayed on the ...

87. Problems mapping List with Hibernate xdoclet tag    forum.hibernate.org

In the meantime I have also tried this: /** * Returns the keyword list associated with the referenced physical asset. * * @hibernate.bag name="keywords" lazy="true" inverse="true" cascade="delete" * @hibernate.collection-key column="keywords_id" * @hibernate.collection-one-to-many class="java.lang.String" * @return List of keywords */ public List getKeywords() { return keywords; } Which results in Hibernate not understanding 'java.lang.String' - do I really have to map this ...

90. List containing null values with joined-subclass    forum.hibernate.org

Hibernate version: 2 Mapping documents: i'm not allowed to post them online sorry Code between sessionFactory.openSession() and session.close(): query q = session.createQuery("select sp from " + "ServiceProviderTypeImpl as sp inner join fetch sp.serviceIDInternal si " + " where si.value=:val"); q.setString("val", "00020020"); List l = q.list(); ServiceProviderTypeImpl st = (ServiceProviderTypeImpl) l.get(0); Name and version of the database you are using: postgresql 7.4.5 ...

91. One-based list indexes, how?    forum.hibernate.org

Hi all, I am using Hibernate to access data in a legacy database. I have a class (Order) that has many line items. My Hibernate mapping of the line items in the Order class is as follows... However, the line_number column used above is one-based, that is, int he ...

92. Lists in Hibernate    forum.hibernate.org

Hibernate version: 2 Hello, I have a question on how hibernate handles Lists. Our application has an object, say A, with an ordered collection of items (say a list of B objects) on it. We are supposed to persist the order in which the user adds B's to A, hence we are using a List. I fully understand that hibernate requires ...

93. Caching hibernate lists    forum.hibernate.org

Hi, I am working at Helsinki University portal project, where we are using hibernate and Spring-framework as a base for our system. We have everything working quite perfectly, except for few issues with caching. In our setup we have a node - tree, where we quite often query node children for a node and also use node data. What we have ...

94. many-to-many list doesn't poplulate association table    forum.hibernate.org

Newbie Joined: Sun Sep 19, 2004 12:22 am Posts: 6 I'm trying to start learning hibernate with a simple example, but have managed to get myself tangled up in my own underwear already. I wanted to map books and authors as a many to many relationship. The authors have order, so each Book has a List of Authors. An author has ...

95. Why hibernate recreates all list (mapped as ) eac    forum.hibernate.org

I am using a List field in my domain model class. It represents many-to many association. It is umidirectional association betwen Class1 and Class2. In mapping I am using for this list. The QUESTION is: Why hibernate recreates list (mapped as reprezenting many-to-many association) each time I simply add new element to it? Hibernate version: 2.1.6 Domain model classes: ...

96. session.filter + query.list()    forum.hibernate.org

hi... i've a problem i need to obtain something like this: Hibernate version: 2.1 Mapping documents: not necessary Code between sessionFactory.openSession() and session.close(): List list = session.createCriteria(...).list(); list = session.filter(list, "where x > 1"); the problem is net.sf.hibernate.QueryException: The collection was unreferenced how can i resolve my problem? thanks. Marco Full stack trace of any exception that occurs: net.sf.hibernate.QueryException: The collection ...

97. Null Elements in List or Array    forum.hibernate.org

Hi, I found nothing about null elements in a list and how hibernate maps them. In a test case hibernate just ignores them, so a list with one null element is saved as a null. Or a list with some null values at the end of the list, the size of the list after saving it is smaller than before. Null ...

98. Many-to-one association: listing all groups and its members    forum.hibernate.org

Hibernate version: 2.1.4 Mapping documents: Code: ...

99. StaleObjectStateException after List reordering....    forum.hibernate.org

Newbie Joined: Fri Oct 03, 2003 6:47 am Posts: 15 Hi, I use Hibernate 2.1.6 and use versioning for concurrency and things work just fine. I have a problem with a side-effect after "reordering" a Collection List. Reordering means that two of the items switch place with each other. I let the user move Items up and down in the GUI ...

100. list association example    forum.hibernate.org

I'm trying to set up a unidirection one to many list association in my application. I've read that hibernate should handle populating the index column automatically, but when I tried it this was not happening. I've read that when using a bidirectional association the index has to be maintained manually (again, currently using unidirectional), so I tried this and it did ...