List 10 « Map « JPA Q&A





1. Trouble with @Embedded List<>    forum.hibernate.org

Newbie Joined: Thu Oct 19, 2006 9:11 am Posts: 3 Hi all, I have scoured the forums and the documentation to no avail. Maybe someone can point me at the document that I missed, or if it's a simple, silly mistake point me in the right direction. Thanks! I am implementing an application using the new EJB3 / Hibernate Annotations peristence ...

2. Parent-Child List Problems    forum.hibernate.org

Newbie Joined: Thu Oct 19, 2006 11:28 am Posts: 4 Hello everyone, I am having problems persisting using detached parent-child Lists. Whenever I attempt to get() the parent object from the database and add a Child object, I am unable to persist the objects (see below). The system just hangs until it finally times out. Why is this occuring, how can ...

3. Legacy mapping question: numbered columns to a Java List    forum.hibernate.org

You could do something with a parameterized UserType. Something like: Code: ...

4. Java stack overflow error with long IN lists    forum.hibernate.org

Author Message pib Post subject: Java stack overflow error with long IN lists Posted: Thu Oct 19, 2006 8:40 pm Newbie Joined: Tue Oct 17, 2006 9:53 pm Posts: 3 With Hibernate 320ga a long "in" list can result in a stack overflow error during the parsing stage. For example, a query element like where x in (:x) or ...

5. indexed list collection autogenerating the index    forum.hibernate.org

Hi. I'm creating a catalog navigation servlet using hibernate for persistent layer. I have basically two tables, catalog and category ones. They are references by a foregin key, each catalog contains some categories. This foreign key is on category table, referencing one catalog. In the catalog mapping xml file, i have mapped the many-to-one relationship using a , with a

6. table list of database    forum.hibernate.org

7. Error reorder many to many map list    forum.hibernate.org

Hibernate version:3.1.3 Database: Oracle Hi, I have a basic question. I shows all relevant stuff below (which seems long), but summary is all it is below: I have an ordered list map using many to many. The problem is that I can add an item to the list. I can delete an item from the list. However, I cannot order the ...

8. Query return a list of same record.    forum.hibernate.org

I am using hibernate query language WHERE clause to select some records from my table. it returns the correct number of records. The first record is correct. but all subsequent elements are exactly the same as the first record. I wonder why it is doing that. please help. Thanks Code here: String SQL_QUERY = "from Roleauthority roleauth where roleauth.Id=1"; Query query ...

9. One-to-many self association using List    forum.hibernate.org

I have a one-to-many self association that was working fine as TreeSet with sort=natural. I decided to switch to using List but Hibernate keeps complaining about "null index column for collection." Here is my mapping (Note the set is commented out but was working fine for me.)





10. using query.setParameter(position, value) with in and a List    forum.hibernate.org

So I need to set a JDBC style parameter to a List with the in "in" operator. I can't used named parameters in this instance so it has to be set by position. I'm trying to do a query like the following: from Document d d.id in (?) and I pass in a list of Integers as the parameter. But I ...

11. Best Way to Deal w/ Database Constraints and List Mappings?    forum.hibernate.org

I'm wondering if anyone has any recommendations on how to deal with database constraints, especially in regard to List mappings. Here's my situation: * I have a parent-child relationship. The child is collection is ordered. * The database has unique two-column index on the parent_id and seq_no fields in the child table. * Whenever I am forced to reorder (e.g. by ...

12. Problem Listing the query results    forum.hibernate.org

Hi The follwoing code works fine with Oracle.But it gives error with DB2 Query queryToGetTheAppDefn = session.createQuery(" ");//Query // to get the totalows in the table ScrollableResults scrollableResults = query.scroll(); scrollableResults.last(); totalRows = scrollableResults.getRowNumber() + 1; // To fetch specified number of records query.setFirstResult((Integer.parseInt(currentPage)-1)*Integer.parseInt(rowPerPage)); query.setMaxResults(Integer.parseInt(rowPerPage)); return new ListingWrapper(totalRows,query.list()); With DB2 it gives the following error. Am including trace : Caused by: ...

13. Problem Listing the query results    forum.hibernate.org

Hi The follwoing code works fine with Oracle.But it gives error with DB2 Query queryToGetTheAppDefn = session.createQuery(" ");//Query // to get the totalows in the table ScrollableResults scrollableResults = query.scroll(); scrollableResults.last(); totalRows = scrollableResults.getRowNumber() + 1; // To fetch specified number of records query.setFirstResult((Integer.parseInt(currentPage)-1)*Integer.parseInt(rowPerPage)); query.setMaxResults(Integer.parseInt(rowPerPage)); return new ListingWrapper(totalRows,query.list()); With DB2 it gives the following error. Am including trace : Caused by: ...

14. Mapping from List Collection to a single Column in a table    forum.hibernate.org

Hibernate version: 3.2GA I have tried to seach many places, but have not found a solution or a description of my need/problem. I need to map a List to a single Column in a table. The Job contains a list of Arguments, but I would like Hibernate to convert from the database column a string to a list of arguments. See ...

15. Query.list() throws exception    forum.hibernate.org

Hi, I really need help to resolve this problem because I already did a lot of search but got no answer on this. My project is a J2EE application which use JBoss, Hibernate and SQL Server 2000. I'm a hibernate beginner. My project works fine when accessing MySQL server. But after I switch to the SQL Server. I got following exception: ...

16. save & list in 1 session    forum.hibernate.org

JayeshJ, tx, I do use a composite-id here and implement the equals and hashCode methods but I don't think it's related to the problem. In the topic you mentioned the problem was getting the newly added item from a Set. I am trying to get a list of ALL users and the newly added one is not yet in it. However, ...





17. Mapping to a Map>...    forum.hibernate.org

I need to map a one-to-many relation as a Map>, but i still did not find the solution. Before the db update i was using the following mapping : Code: ... ...

18. problem persisting list with access=field with hib 3.1    forum.hibernate.org

Hi, Good morning! I am seeing a strange interaction between cglib, hibernate & what I'm trying to do in my code. My mapped object has a list member variable with access="field". I am not able to update the list with new objects. Here are the details - mapped classes - A, B, C A has a member variable of type B, ...

19. Why do we need list-index ??????????    forum.hibernate.org

OK so i have 3 tables... PRODUCT_GROUP PRODUCT_SUBTYPE and the many to many table... PRODUCT_GROUP_SUBTYPE The last table initally had 2 columns just the ids of the GROUP and SUBTYPE tables. This seemed to work perfectly well if i wanted to use sets, but didn't work at all if i wanted to use lists, as a list requires a list-index or ...

21. List returning size correctly but values as null    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using:oracle10g The generated SQL (show_sql=true):select otcoperati0_.OTC_OP_ID_OPERATION_PK as OTC1_84_, otcoperati0_.OTC_OP_ID_STATE as OTC2_84_, otcoperati0_.OTC_OP_DT_OPERATION as OTC3_84_, otcoperati0_.OTC_OP_NR_OPERATION as OTC4_84_, otcoperati0_.OTC_OP_ID_OPERATION_TYPE as OTC5_84_, otcoperati0_.OTC_NM_ID_MECHANISM_FK as OTC6_84_, otcoperati0_.OTC_PT_ID_PART_SELLER_PK as ...

22. Mapping list (Informix collection datatype)    forum.hibernate.org

Newbie Joined: Tue Dec 05, 2006 11:09 am Posts: 1 Hi all, I am using Informix 9.0 with Hibernate version 3.0.5. I have a table with column of type list (Informix collection datatype). Hibernate Tools plugin generated the mapping for the column as java.lang.Object. when i used it like that i get the error saying that org.springframework.beans.factory.BeanCreationException: Error creating bean with ...

23. another list-index problem: list_index = 0    forum.hibernate.org

Newbie Joined: Tue Sep 26, 2006 8:34 am Posts: 16 Location: Paris, France Heya, I'm trying to map this FilterChain 1 <---> 0..* AbstractFilter using a list, because filter order does matter. My problem is that my list-index is not automaticaly managed by hibernate, which result in when i try to add a concreat filter to my list and save the ...

24. List Behavior    forum.hibernate.org

I have tried the following with 3.1.3 and 3.2.1: create table test_parent( parent_key NUMERIC(3) not null, description varchar(40), hibernate_version numeric(17), CONSTRAINT pk_test_parent PRIMARY KEY( parent_key ) ); create table test_child( parent_key NUMERIC(3) not null, child_key NUMERIC(3) not null, description varchar(40), hibernate_version numeric(17), CONSTRAINT pk_test_child PRIMARY KEY( parent_key, child_key ) ); INSERT INTO test_parent ( parent_key, description, hibernate_version ) VALUES ( 1, ...

25. Query.list() returns no results, but generated SQL does.    forum.hibernate.org

I found the answer to my question (below). The problem was an un-committed manual update to the db. Hibernate default isolation level means that such data can't be queried. A simple commit fixed the problem. "I have Query object generated from hql. I set some parameters, call the list method, and get an empty list. If I execute the generated SQL ...

26. List-index properties are not updated if item is deleted    forum.hibernate.org

Hi, I have a list of objects that are indexed using a list-index mapping. The objects stored in the list have a property, 'sequenceNumber', that is mapped to the column used as the list index. When I delete from the list and then persist the changes, the objects in the list do not have their 'sequenceNumber' property updated. Hence the database ...

27. failed getting list using JOIN with createQuery    forum.hibernate.org

Hi All I use hibernate 3.2 I try to get list of object using createQuery() "Query query = sess.createQuery("from GaTran g join fetch g.useridin join fetch g.useridout join fetch g.vhctype join fetch g.memberid join fetch g.priceid join fetch g.appparamid where g.vhctimein >= :startdate and g.vhctimeout <= :enddate and g.vehiclenum like :inputsearch").setCalendar("startdate", startdate).setCalendar("enddate", enddate).setString("inputsearch", inputsearch.toUpperCase()); List lst = query.list();" How come when ...

28. dinamic multiple values list to filter my query...    forum.hibernate.org

Hi, i have a hibernate implementation of my searchDao, before this dao was implemented using Ibatis SQLMap. My problem is that the searchByKeywords method of searchDao receive a string separated by ";". Each token in this string is a value for the where clause. I dont know how many token contain the string and i need to filter my search with ...

29. How to execute a dynamic where clause int generated list    forum.hibernate.org

Hi all, I have a requirement which i couldnt make the path for the past 1 week. I want to make an advanced search filter.So i created a view out of the tables & coded cfg file,POJO class,mapping file.Its all working. I load a jsp page which retrieves all the column datas So that the user can choose in multiple and/or ...

31. org.hibernate.NonUniqueObjectException in Criteria.list    forum.hibernate.org

Hi folks, I've been using Hibernate for several months now and I'm usually able to get by seemingly obscure errors and I've learned some of the trade offs with Hibernate. But this one is completely mistery: session.createCriteria(prototype.getClass()).add(Example.create(prototype)).list(); gives me: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with th e session: 'prototype' in the above call is ...

32. pull data from two tables into a single list correct order    forum.hibernate.org

Newbie Joined: Wed Jan 03, 2007 11:41 am Posts: 2 Hi, I am trying to pull data from two tables into a single list, how can I get the total result ordered correctly so that it orders the full result set. Currently, when I run my query, the data comes back in the correct order for each of the individual queries ...

34. Simple mapping of Map> kick    forum.hibernate.org

I had assumed this would be a simple mapping (via XML) but it is eluding me so far. Nutshell: table consists of userid, appid, roleid. I want each User to have a Map> where Apps and Roles are what you'd expect. Is this possible? I've tried a lot of combinations and so far I've been SOL. If this is a ...

35. outofmemory occurs while listing data using hibernate3.0    forum.hibernate.org

I have already post this following problem "While retriveing data from postgres using hibernate 3.0 its taking too much of time some time its showing outofmemory error query sample hsql query from Candidatemaster as a where a.userpk in (select b.userpk from UserAddress as b where b.statepk=1 and b.addres_type=:code) For Table we created index allso but it still showing out of memory ...

36. JSP ConcurrentModificationException w/ Hibernate result list    forum.hibernate.org

Hi. I have a JSP that receives a bean from a Struts action (servlet). The bean is a List that is the result of a Hibernate query. The list contains pojos that are received as search results from the back end. These pojos are in a detached state, and the session has been closed after the query. Each pojo contains two ...

37. Duplicate objects in Criteria.list() ?    forum.hibernate.org

hibernate ver : 3.2.0.cr2 (part of JBoss 4.0.4GA) Is it normal for a criteria to return duplicate objects? Like : Code: Criteria crit = getSession().createCriteria(Group.class); crit.add(some criterions); crit.addOrder(Order.asc("comp_id.key")); List result = crit.list(); if (result.get(1) == result.get(2)){ System.out.println("woot ?"); } I tried ...

38. Retrieving latest entry in a list    forum.hibernate.org

I have a list that represents the state transitions in a document workflow. I want to add a method to my DAO that will retrieve all documents that have a particular state, but can't work out the HQL to do this. My environment is Java 5, Oracle 9i, Hibernate 3.2. Here are the relevant snippets of annotated Java: Code: @Entity @Table(name="aml_institution") ...

39. Hibernate PersistentList v/s Java List    forum.hibernate.org

Hi, I am persisting a class containing a member variable whose type is List. When I try to retrieve the persisted instance of this class, the List object is replaced by a PersistentList, which is a hibernate class. My application is such that the persistence is done at a layer other than the client, and therefore the inclusion of ...

40. Invalid data conversion when switching from Sets to Lists    forum.hibernate.org

Author Message mbabauer Post subject: Invalid data conversion when switching from Sets to Lists Posted: Tue Feb 06, 2007 10:19 am Newbie Joined: Wed Jul 05, 2006 2:26 pm Posts: 5 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.2 GA Mapping documents: Using Annotations Code between sessionFactory.openSession() and session.close(): Using Springs HibernateTemplate Full stack ...

42. List withou index column in one-to-many relation    forum.hibernate.org

Hello, I have got two tables in myDataBase, with a relation one-to-many (Parent/Child). In my class Parent, I have an attribute, called childrens, which is the type List. I want use hibernate, and load all the childrens in the attribute, but I don't have any column index in the table CHILD. How can I create an artifical index? Thanks

43. HQL on attribute List    forum.hibernate.org

44. Parent/child in list with order    forum.hibernate.org

45. Hibernate ClassCastException when Query list() called..    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2 Mapping documents: Code: ...

46. list collection and self join problem    forum.hibernate.org

I have the following use case: A hierarchical, tree like organization structure where each organization is a parent of zero or more organizations. The children organizations are ordered. this is implemented with the following table in the database: table Organization ( id int not null, /* primary key, autoincrement */ parentId int null, /* can be null if the organization is ...

48. max-Function with subquery returning a list    forum.hibernate.org

hello, i have a table A with a field B and what i want seems to work in SQL but not in HQL or which syntax can i use? SQL: SELECT MAX(B) FROM ( SELECT MAX(a.B) FROM A a WHERE .. GROUP BY .. HAVING sum(C) > 0 ) because of a GROUP BY + HAVING, i get several result-groups but ...

49. Error trying to save objects with a List member    forum.hibernate.org

Newbie Joined: Thu Feb 22, 2007 7:05 pm Posts: 2 Hi there, Im an Hibernate newbie, and Im trying to load a database with many objects I had saved in an XML file. These objects include a field which is an ArrayList. I save the first one fine, but when I try to save the second one I get an exception. ...

50. criteria.scroll returns duplicates, criteria.list does not!    forum.hibernate.org

Hibernate 3.2.2 and 3.1.3 I have a simple query to load Cars based on Classification, (many to many relationship) I have applied Criteria.DISTINCT_ROOT_ENTITY to prevent duplicates that can arise. Code: Criteria c = session.createCriteria(Car.class) .addOrder(Order.asc("id")) ...

51. Map a list/set/array to multiple columns in table    forum.hibernate.org

Hibernate version: 3.2 Is it possible to map similar type of columns to one property (or rather in a set or array)? For Eg: I have a denormalized table where I store individual tooth information in each column of the table say col_tooth1, col_tooth2, col_tooth3 ...col_tooth32 . Rather than having a one-to-one mapping of a column to a property in the ...

52. list index column required to allow nulls    forum.hibernate.org

Is it possible to make a List index column to not allow nulls, as this seems logical, given that at least one element, #0, must be present for the list to actually exist? It seems that hibernate requires an index column for a list to allow nulls, as we got problems when the column did not (allow nulls). It looks like ...

53. Entity with multiple list and Hibernate Mapping    forum.hibernate.org

Hi i have a some doubt defining my relations into mapping files. My relations are: Article (id,name) |__ ArticleStock (inherit from Article, id_stock, series (List), stocks (List), lotes (List), ubications (List)) In some situations my app need only Article data, in other ArticleStock withs only STOCKS collection, and in others ArticleStock with SERIES collection. How can i express this into HIbernate ...

54. Unmodifiable list with getter    forum.hibernate.org

Hi, If I have a property of type Set in my persistent class, I would like the getter to return an unmodifiable list, to be sure all changes are done through special convenience methods of adding and removing items. Hibernate in Action suggested using Collections.unmodifiableSet which I thought sounded like a good idea. But then I read that returning a different ...

55. problem by deleting of child in parent list    forum.hibernate.org

Hi, I am newbie in hibernate and want to ask something for many-to-many relation. I have to solve following situation: movie can have a lot of copies, each copy has always one movie. Between customers and copies, there is a separated table called Rental. Rental is quite complicated beacause I have to get copy_id and customer_id as part of the key. ...

56. Mapping a list with GROUP BY clause    forum.hibernate.org

Hi, I have mapped my User properly as well as a List of (financial) Transactions the user has made. This all works fine. Now however, I wish to not map every individual transaction the User has made, but just the sum ordered by the currency. So the result of the SQL: SELECT currency, sum(amount) as amount from transactions GROUP BY currency; ...

57. list vs scroll    forum.hibernate.org

58. Session.refresh(object) sets session=null of child list    forum.hibernate.org

//creating a parent Requirement req = new Requirement("parent"); SessionFactory f = KLTMContext.getSessionFactory("test_hibernate"); Session s1 = f.openSession(); Transaction tx = s1.beginTransaction(); s1.saveOrUpdate(req); tx.commit(); s1.close(); //adding a child s1 = f.openSession(); Requirement child = new Requirement("child"); Requirement req2 = (Requirement) s1.merge(req); tx = s1.beginTransaction(); req2.addChildRequirement(child); s1.saveOrUpdate(child); tx.commit(); s1.close(); //loading the parent and refreshing parent and child ...

59. relation list containsAll    forum.hibernate.org

Hi, I have a many-to-many relation and I would like to implement the following "statement" using Hibernate criteria API (the output must be a criterion): contains all . For example, let's say that =('a', 'b') and I have 2 rows in the DB with the following values in the relationList Row 1: ('a') Row 2: ('a','b','c') Row #2 answers the ...

60. Cascade of list with all-delete-orphan : child not deleted    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1.3 Mapping documents: Code:

61. java.lang.NullPointerException about the list.add    forum.hibernate.org

Hibernate version:3.01 I want to get a list of the table VwOdaycount ,The list should contain the fday (taken as the key word of the list) and the fcount(taken as the object of the list). the HQL is ""select model.fday,model.fcount from VwOdaycount as model where model.fitemId="+itemID + "and model.fyear=" +year +"and model.fmonth="+month+"order by model.fday asc"; " Full stack trace of any ...

62. Changing an order of list items    forum.hibernate.org

I have a problem with changing an order of items in the Hibernate managed collection (List). There is an object called Zone that has some actions connected. ====================== Code: @Entity public class Zone extends Persistent { ... @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @IndexColumn(name = "idx") @JoinTable(name = "zone_action", joinColumns = { @JoinColumn(name ...

63. running hql's on Lists...    forum.hibernate.org

64. Inheritance and list mapping    forum.hibernate.org

Hello I'm using Hibernate 3.2 (in JBoss 4.0.5) and Oracle 10i. I have the following situation: A hierarchy of classes: class A class B extends A class C extends B class D extends C Classes A,B and C are all stored in the same DB table, AT1. Class D has its own table DT2. The subclassing is done using a discriminator ...

65. Object mapping slow for retrieving lists    forum.hibernate.org

Hi, we are completing a project with hibernate but have stumbled upon a performance problem when retrieving a list of about 100 objects. The objects are retrieved with a named query in hibernate, but as I see from my logging, hibernate really is the bottleneck as mapping the database results to the objects takes up most of the time. Retrieving myself ...

66. Preferred collection interface: Set or List?    forum.hibernate.org

For associated collections (that can e.g. be cascaded to) the preferred collection interface seems to be Set (mapped using the tag). The rationale being that Sets are closest to the relational model. For collections returned from queries, however, the only choice seems to be a List (or an Iterator). This doesn't seem consistent, but there may be a good reason, ...

67. Getting anonymous objects back from SQLQuery.list()    forum.hibernate.org

Author Message matbrown Post subject: Getting anonymous objects back from SQLQuery.list() Posted: Thu Apr 19, 2007 11:22 am Newbie Joined: Fri Mar 30, 2007 5:23 pm Posts: 16 Location: New York, NY Hello, I am using native SQLQueries to perform searches on my database, and whenever I use the addJoin() method, the object returned by SQLQuery.list() are anonymous objects ...

69. Query with a list of Criterias    forum.hibernate.org

Hello everyone, Im having an Object "User" which gets mapped through hibernate and gets all the attributes filled. Now i have an array with fields (the names are actually the same as the DB-column names). Now my question: Is it now possible to take this User Bean with data and get the list of criteria fields and create a second array ...

70. Properties contained in a list    forum.hibernate.org

Hi I have an object (Client) that has a list of addresses. I want that the client have a main address, a billing address and a shipping address, all contained in the list of addresses. How can i reference those type of address without Code: @Entity() @Table(name="Clients") public class Client extends BasePersistentObject { ...

71. List-index prob    forum.hibernate.org

Hi, i have got a problem with setting the index of a List in may database-entries. I have got an User-Object (mapping): Code: ...

72. many-to-many Lists    forum.hibernate.org

Hi there, is there a cheap way to map a many-to-many relationship as a list? I've got a table like this: ID | POSITION | VALUE And there is a many-to-many relationship to this table. As a set this works fine, but now I want to make it as a list, thats sorted by POSITION. If I make it like this: ...

73. Caching lists returned by a query    forum.hibernate.org

74. Query list problem    forum.hibernate.org

SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session =sessionFactory.openSession(); String SQL_QUERY = "from T1 AS t1, T2 AS t2 where t1.xxx='value' and t2.yyy='value'"; Query query = session.createQuery(SQL_QUERY); result = query.list();

75. How to map list of lists to java (from legacy table)    forum.hibernate.org

Author Message bafz Post subject: How to map list of lists to java (from legacy table) Posted: Tue May 08, 2007 3:55 am Newbie Joined: Tue Jun 28, 2005 10:20 am Posts: 15 Hello, my problem is to map a legacy table without primary key to java. And no foreign keys are defined in this table. The table contains ...

76. Hibernate list and idbag    forum.hibernate.org

Hi, My question is more of a design issue than a technical problem. Part of it has been covered in the post http://forum.hibernate.org/viewtopic.php?t=973053. I have two model objects : Page and Line. A page may have multiple lines, and a line must belong to exactly one page. I also want to put some ordering on the lines of a pages, since ...

77. Design :: How to expose API for adding new object to a list    forum.hibernate.org

Hey, I have a swt client and a stateless facade that expose the server API to the client. Suppose that I have two objects - Company the contain list of workers I want to write a generic API to the client that create,add,update,delete objects. Some objects, like worker need to be created in a parent context. I mean that in order ...

78. remove() on Hibernate list with index : Constraint violation    forum.hibernate.org

Newbie Joined: Thu Apr 06, 2006 2:09 pm Posts: 14 The problem When you map a one-to-many association using and Hibernate indexed persistent list with a join table (so we need to use many-to-many with unique="true" as one-to-many does not handle join table) any remove on this list leads to constraint violation during database synchronisation. Class and mapping Code: package org.hibernate.test.collection.list; ...

80. Confusion regarding Usage of Hibernate collection type List    forum.hibernate.org

Hi, Iam a newbie. I have some confusion regarding usage of index column in List. I have gone through the reference documentation, in that I see below two differnt usages of List index column Section 7.4 - Bidirectional association ------------------------------------------ In this section in the Person, Address example. I see that in Address the list-index column = "peopleIdx". But I don't ...

81. Hibernate List One-to-many delete problem    forum.hibernate.org

Hibernate version. 3.2.3 I setup the one to many relationship between two table/object. I set the cascade to all. However, the update and save will be working for relationship. but the delete will not working. Everytime, I remove on object on the list, and save the object. From the showed SQL, I saw that it will run the update sql statement ...

82. put a 0 in a list and get 1 as result![Hibernate related]    forum.hibernate.org

i have got a very wired problem. put a 0 in a list and get 1 as result in my project. here is the test code! java.util.List alist =new java.util.ArrayList(); alist.add(0); out.print(alist.get(0)); i run the text code in a jsp in the tomcat. as you see, i put 0 in the list, but get 1 as result. i wonder why? after ...

83. class cast exception while casting the list object to entity    forum.hibernate.org

i am getting the same error public String ...

84. Lists not linked to primary key of parent    forum.hibernate.org

86. How to map List in hibernate    forum.hibernate.org

list-index column just like the primary key column in your table. For example, if you have two tables like the following Parent( ParentId int Primary key, FName, LName ) Child( ChildId int Primary key, ParentId int, FName, LName ) Then Child Id is the List-index which make each element in your list is unique.

87. Mapping many-to-many association using List    forum.hibernate.org

Thanks for your advance. But I still got the following problems: 1. specify inverse="true" in customer side => will only insert AccountIndex 2. specify inverse="true" in account side => will only insert CustomerIndex 3. specify inverse="true" in other side => it will insert the record twice, first record is inserting CustomerIndex, another one is AccountIndex. Is it have anyway to insert ...

88. Null Items appear in the list when data reteived    forum.hibernate.org

Hi amila733 Thank for you response. I think I have found the problem. It seems that if I have one row with id 7 in my database table then 6 nulls are added before the actual selected object in the list. No idea why this is happening. Very strange if you ask me.

89. Persisting a list of object    forum.hibernate.org

90. [Reverse Engineering] Using an indexed List?    forum.hibernate.org

I've got a table that looks like this (just like the example in the hibernate docs): OrderLines ------------- ID OrderID LineNumber LineID Right now I'm mapping this table by using the reverse engineering function in Hibernate Tools. I'm extending the DelegatingReverseEngineeringStrategy to change some names around, and I want to add some code to this. Per default my Order class will ...

91. list-index and one-to-many mapping    forum.hibernate.org

I'll reference myself for this one... I asked a related question in http://forum.hibernate.org/viewtopic.php?t=974248 (to which unfortunately I haven't received any answer - I moreorless have figured it out myself anyway). Quote: Suppose you have two model objects : Page and Line. A page may have multiple lines, and a line must belong to exactly one page. I also want to put ...

92. How can I delete a row in List?    forum.hibernate.org

I'm studying hibernate for next project. As I wrote a few test codes I faced some problem. In my test project (named Blog) there is an article and some comments article has rows(id, writer, content) and there are comments for some article Comments -> (a_id, id, writer, comment) a_id is a key which direct to article id is and id value ...

93. DELETE of one-to-many(list) causes extra UPDATEs?    forum.hibernate.org

Newbie Joined: Wed Oct 15, 2003 4:31 pm Posts: 17 Specifics below. Here's the summary. I have two objects -- "StuScheduleRoot" and "StuSchedule". StuScheduleRoot is the parent of a one-to-many relationsip with StuSchedule (i.e. each StuScheduleRoot may have one or more StuSchedule's associated with it). It's very common for there to be only one StuSchedule (child) per StuScheduleRoot (parent). For the ...

94. Make list using hibernate    forum.hibernate.org

95. previously-persisted List data lost on update    forum.hibernate.org

I've got an odd problem where data in a List that was once persisted gets nulled out on an 'update' operation. For a trivial example, class T1 has a one-to-many relationship with T2, implemented thus: Code: T1 t1 = new T1(); //T1's constructor creates a list and adds a T2 to it t1.nextT2(); //creates another T2 object and appends ...

96. performance issue with hibernate return java.util.list    forum.hibernate.org

I use hibernate 3.2 with the following code List listobj = sess.createQuery("from TransactionTx g left join fetch g.user left join fetch g.user1 left join fetch g.appparamid where (g.user = :userid or g.user1 = :userid)").setEntity("userid", user).list(); with hbm file as a follow

97. List Mapping has null values..    forum.hibernate.org

I have a List mapping in an object as below - When I retrieve the 'Alert' object, I get the list of 'AlertData' in ...

98. Convert list to class:Exeption:couldn't find setter    forum.hibernate.org

String query = SELECT p1,p2 FROM classA WHERE p2 = 1 and p1 in (select p1 from classB where Bprop='email') List list = session.createSQLQuery(qStr) .setResultTransformer(new AliasToBeanResultTransformer( ...

99. Select by List of primary keys    forum.hibernate.org

100. collection persistence: what if I create a whole new list?    forum.hibernate.org

SQ_CATEGORY ...