List 7 « Map « JPA Q&A





1. Parent/child - using list, hibernate updates index to null    forum.hibernate.org

Hi ya, we have a simple parent child situation - where we want to have children ordered in specific order. For this we have children defined in a list and have defined an integer index column. Everything works ok - except if we add constraint to the database to the index column to be NOT NULL. While debugging what Hibernate does ...

2. Need Guidance on gen. list with parms of mult. objects    forum.hibernate.org

Ladies and Gentlemen; I have consulted the Hibernate Reference Documentation and my available Hibernate Reference for this question. It may be awnsered, but perhaps I am not grasping so here goes: I have two objects A and B and I need to return a list that has elements of both objects in the list. Object A has 4 parameters that make ...

3. Mapping with two classes and java.util.List    forum.hibernate.org

4. Help with mapping a List    forum.hibernate.org

...

5. Problem persisting List and Array of persistable objects..    forum.hibernate.org

Newbie Joined: Thu Sep 23, 2004 2:35 pm Posts: 5 Hello, Please help.. It's kinda urgent.. Can't figure out what is wrong... I have an object "HbmTradeHistory" . It is mapped and it's working just fine.. I can perform query agaist the database and retrive objects from it.. Now I'm getting to the point where I need to populate the database.. ...

6. Lists gaining null element after query.    forum.hibernate.org

Hi, I am getting some strange behaviour when I load instances of an object called POF. A POF has 2 List collections lineItems and actionHistory. I have 1 POF persisted in the database which has 1 LineItem in the lineItem collection and 2 Actions in the actionHistory list. When I load the POF, the lineItems and actionHistory lists are 1 element ...

7. how to synchronize removal of items from list to db, clarif.    forum.hibernate.org

Author Message adcworks Post subject: how to synchronize removal of items from list to db, clarif. Posted: Tue Oct 26, 2004 9:28 am Senior Joined: Fri Jun 18, 2004 10:17 am Posts: 140 Hi, I am trying to understand how to synchronize removed items from colletions in detached objects is made to the db. I have a web-based 5 ...

8. EntityPersister/sql-insert w/ discriminator or list index    forum.hibernate.org

I'm currently using a custom EntityPersister to use stored procedures for CUD operations. Now I need to use subclass/discriminator columns and also mappings with an index column. I can use getDiscriminatorSQLValue() to find the discriminator value, how do I get the value of my list index? (eg. ) I'd also like to switch to using Hibernate 3's tags ...

9. Using XML entities to get the list of mappings    forum.hibernate.org

We use multiple hibernate.cfg.xml for various environments but the list of mapping files are always the same. Therefore I decided to create a file with all the mapping and use an xml entity to 'import' it in multiple files. My .cfg.xml files look like this: Code:





10. need a List as the many in a 1-*, sorted on Date    forum.hibernate.org

Hibernate supports the List in one-to-many associations, but the index must be an integer. I have the following mapping for medical office patients and the prescriptions they are currently taking: Code:

11. Simple way to persist a List of strings?    forum.hibernate.org

12. Map of Lists    forum.hibernate.org

Hi, I am using Hibernate 2.1.6 and I was wondering if there is a way to get a map of lists. (Sort of similar to doing a "group by" in a query.) Scenario: A an example scenario would be that I want to have a map keyed with a region and each region to have a list of sales people. Any ...

13. 2 one-to-many lists to subclasses in table-per-hierarchy    forum.hibernate.org

Author Message takejiN Post subject: 2 one-to-many lists to subclasses in table-per-hierarchy Posted: Tue Nov 16, 2004 7:00 am Newbie Joined: Mon Nov 15, 2004 1:52 pm Posts: 7 I have extracted the following example from a problem we're having on a software in production. I didnt find another post or an entry in JIRA for it ; if ...

14. Query.find() returns List with same objects    forum.hibernate.org

Sorry about two posts about the same subject. The one you replied did not have all the necessary information. That was a premature "enter key" action. I understand lists allow duplicates. But the database tables have two unique customers with id 1 and 2. But the query.find always returns two customers with same id, 2. thanks Here is my orinal post. ...

15. Query with a list    forum.hibernate.org

I can't write my query. Here is the class generated by hbmToJava public class DicoLigne implements Serializable { /** identifier field */ private Long id; /** persistent field */ private String concept; /** persistent field */ private List traduction; } The list referes to a List of persitent objet (Mot.class) Mot.class : public class Mot implements Serializable { /** identifier field ...

16. one-to-many list mapping without a index field    forum.hibernate.org

Hibernate version:2.0.3 Here are the mapping documents for my two objects. The classes themselves are simple POJO's with a public getter and setter for each field. Person Mapping file Code: ...





17. MySQL - Many-to-Many Access fails while accessing the List    forum.hibernate.org

Author Message cham Post subject: MySQL - Many-to-Many Access fails while accessing the List Posted: Fri Dec 03, 2004 10:54 am Newbie Joined: Fri Dec 03, 2004 10:37 am Posts: 3 Hi all, I've fear that this is a real newbie question, but I didnt found any answer for my problem. I have bound 2 tables via an assignment ...

18. Querying first line of List returned by userType    forum.hibernate.org

Senior Joined: Tue Aug 03, 2004 2:11 pm Posts: 142 Location: Somerset I have a user type that maps 5 fields on an Address file (addressLine1, addressLine2, addressLine3 etc) to a list, so that my object can have a collection of address lines rather than the database representation. I'm trying to do an address search using HQL, that is searching on ...

19. [b]How to map a list of abstract classes?[/b]    forum.hibernate.org

1. public class abstract LocatableItem{...} 2. public class Building extends LocatableItem {...} 3. public class Equipment extends LocatableItem {...} 4. public class Location { List locatableItems; void setLocatableItems(List locatableItems) { ...

20. newbie - request help in mapping problem with list    forum.hibernate.org

Hi, Initially it looked very straight forward to do this, but somehow I must have missed something down the road, I tried all sorts of things inside the tag (see below) but failed, so I dug in the manual and in the forum but still couldn't find an answer... I have a class which holds a list of children of ...

21. List vs Bag    forum.hibernate.org

Hi could someone help explain this. In hibernate what is the difference between List and Bag? When is it preferable to use one over the other, and which is the one to go for? At the moment I use the bag element, but in my Java code I'm using the ArrayList collection class.

22. How to persist Map>    forum.hibernate.org

23. Problem with definition    forum.hibernate.org

Hibernate version: 2.0 Name and version of the database you are using: mySQL The problem I am having feels like a Hibernate bug. I have worked around the problem, but it is possible that I will simply hit it again later, so it is better to report it. The problem is to do with the definition detailed below. The Client ...

24. List problem with index    forum.hibernate.org

Hi, I have a problem with a List. I don't want to use a Set, but a List. The Exception wich occurs is below. What do wrong in the mapping file with the List? Hibernate version: 2.1.7c Mapping documents:

25. Suggestions on remote rich client bean list management    forum.hibernate.org

I'm building a rich client application backed by hessian web services and a hibernate data access layer. Various forms show the user a list of beans with a JTable, allowing the user to edit, delete, add new items, somtimes change the order of the items. After all of the changes have been performed, the user presses a "save" button to save ...

26. Hibernate List index decrement    forum.hibernate.org

Hibernate version: 2.1.2 I'm using Hibernate version 2.1.2 and have a question about how Hibernate List indexes are decremented. I'll explain the scenario. ObjectA has a list of ObjectB. I want to delete some objects of ObjectB directly without having to remove them explicitly from the list on ObjectA. The outcome is that the objectB's that I delete will also no ...

27. Hierarchical ACLs (Access Control Lists)    forum.hibernate.org

28. How to efficienly get a list of groups using HQL?    forum.hibernate.org

I have been trying to solve the following problem using Hibernate 2.1.7 First here is the data structure. I have the following tables: - Student table that has 3 fields: id, name and age - Course table that has 3 fields: id, name, level - StudentCourse that has 2 fields: studentId, courseId Below is an example of what the database may ...

29. Is it possible to list all dirty objects in a session?    forum.hibernate.org

From what I understood, you in fact want to know the objects in level 1 cache. At one time I was wanting to print all objects in the cache and I did something dirty to do so. It's absolutly dependent of hibernate implementation. Hibernate doesn't allow to be the cache contain in a clean way. So I did that: Code: ...

30. Adding a list of entities where foreign key not known    forum.hibernate.org

I am sure there is an answer to this but I am not even sure how to word the problem to search for it. The problem is this. I create a Principal object along with a bunch of settings. Obviously the Principal does not have an id until it gets written to the database. But, when I try to send the ...

31. Getting the Size of a Collection(List) with a Criteria Query    forum.hibernate.org

Hi, i'd like to know if it's possible (or better how) i can create a Criteria, where i can select a List of "Reisepaket" where the size of the List "events" is equal 'x' (e.g. x = 0). I searched Documentation and Forum here, but couldn't find any hint. Greets, ap0 Hibernate version: 2.1.7c Mapping documents: Code:

32. Echache not affecting List request    forum.hibernate.org

33. The list method does not return the updated value from DB    forum.hibernate.org

The problem is: when I use clear() or evict(), Im chaging the state of my object to detached, and i do not want to do this, I want only bypass de session cache. I Already change my code instead of use find(), Im using Query, just to set the lockmode, because i saw on the documentation, when use LockMode = Read, ...

34. Strategy for App Defaults or Select Lists?    forum.hibernate.org

HIbernators, On a generic level - I am curious how I can save default values to a database. I want there to be an AppDefaults class that contains a map of key/value pairs. I also want the AppDefaults to be a singleton. Further, the key/values must support CRUD. This is extremely straight forward in OO. However, when I map this to ...

35. index field is not inserted when inserting a list    forum.hibernate.org

Well I'm using SpringFramework for managing transaction, and creating SessionFactory and many other things like this, I've already followed the rules, and couldn't find the reason of my problem. I've got two classes: Order and OrderItem with a bidirectional many-to-one relation. (you can see the mapping files below), the problem is when storing an Order the index property of items list ...

36. Query.list() - Reporting Query get result as a Map    forum.hibernate.org

// a, b, c - properties of objects - not entities Query q = hibernateSession.createQuery("SELECT a,b,c FROM x JOIN Y"); List results = q.list(); ... while (moreResults) { result = (Object[]) it.next(); String a = (String) result[0]; Integer b = (Integer) result[1]; ... ...

37. Hibernate tries to UPDATE when I re-assign List    forum.hibernate.org

I am programming what I intend to be a readonly web application. I have a List variable that I use to store the results of a query and then assign to a List property of a persistent object (this property is not managed by Hibernate). The first assignment works ok, the second causes hibernate to try to update the first record ...

38. Error refreshing list    forum.hibernate.org

39. Problem with the     forum.hibernate.org

40. Problem using index in lists    forum.hibernate.org

41. Sorting a list of items base on the size of the item's set    forum.hibernate.org

public class User{ private Set posts; public getPosts() { return posts; } public setPosts(Set posts) { this.posts = posts; } }

42. list relationship with a where clause    forum.hibernate.org

43. Parent/child with list: please feedback!    forum.hibernate.org

44. bug in queryObject.list ?    forum.hibernate.org

Hibernate version:2.1.6 As an exemple, I have a base class BaseLabel.java : public abstract class BaseLabel { protected String code; protected Date creationDate; protected String label; // setters & getters // equals & hash } public class CountryLabel extends BaseLabel{} public class SecurityQuestionLabel extends BaseLabel{} ... when using ...

45. Query on a list    forum.hibernate.org

46. Unable to do search on List    forum.hibernate.org

Hi I hope someone can help me out on this one. I keep getting : "Index was outside the bounds of the array." exception when doing search on collection. Mapping documents:

47. Middlegen Error, and middlegen mailing lists are no help    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1.8 Mapping documents: None Code between sessionFactory.openSession() and session.close(): None Full stack trace of any exception that occurs: [middlegen] BUILD FAILED: file:C:/JAVAProjects/LASer/LASer/LASerWorkspace/DataAccess/build.xml:75: Could not create task of type: middlegen due to java.lang.NoClassDefFoundError: org.apache.log4j.Category Name and version of the database you are using: DB2 8.2 The generated SQL (show_sql=true): None Debug level ...

48. ConcurrentModificationException updating objects on list    forum.hibernate.org

Author Message alokotsch Post subject: ConcurrentModificationException updating objects on list Posted: Thu Mar 03, 2005 11:46 am Newbie Joined: Tue Oct 12, 2004 9:31 am Posts: 3 Problem description: When I try to update a List of objects I get a ConcurrentModificationException on commit. I am hoping it is a mapping issue but cant pinpoint the cause myself. I ...

49. How to get Map List from HQL?    forum.hibernate.org

50. question on query.list() ?    forum.hibernate.org

Hi Guys, I have a strange problem, when I execute the code mentioned below the list contains repeated entires of first record only ... I tried using session.find() func to fetch all records which resulted in different records but large number of them still repeat... query = session.createQuery("from XDataTO where stype = :var order by sleutel"); query.setString("var", "FUNC"); List list = ...

51. Bidirectional List - For the Record    forum.hibernate.org

For the record, exactly why can't I have a bidirectional indexed list? I understand why it can't be inversely managed because of the sequence. I also know that someplace in the Wiki or FAQ there's some decent explanation, but I just can't seem to locate it! (A link to those documents would be helpful to me and anyone else who reads ...

52. Criteria API and a List of String    forum.hibernate.org

Hello All, I have a bunch of query that needs to be build dynamically so I decided to give the Criteria API a try. I am running into a "syntax" problem and I can't figure out how to write this. For example, lets say I have a User object that as an attribute called groupCd which is a list of group ...

53. List comes back with a size 100 even though only 1 exists    forum.hibernate.org

Thanks for your response Steve. I think I figured out the issue, i am using a list which by definition is an ordered collection. My object has an ORDERING_NUMBER used as an index which has a value of 99 in the database. Hibernate creates a List (defined as an ArrayList) with 100 elements with my object being element 99. Hence 100 ...

54. quests about "list's id that make from xml "    forum.hibernate.org

When using aaa.hbm.xml file and bbb.hbm.xml file, both has attribute 'list', and their ids are as another table's id(tablename:aaa_bbb), this is required. than list has attribute 'index', name : serial but the primary key indeed in database aaa_bbb is serial and aaa's id. would you tell me my errer ? thank you very much Hibernate version: 2.1.2 Mapping document: Code:

55. type conversion error: Criteria.list() for Expression.in()    forum.hibernate.org

Hibernate version:2.1.7 Hibernate Criteria.list() throws class cast exception when I feed search parameters to the Criteria object with Expression.in(). One of the search parameter( lata ) is defined as Integer in the persistent class(RcPK.java). The QueryParameters after adding user selected search parameters looks like this: values[0] = [testmkt] values[1] = [650] types[0] = [hibernate.StringType] types[1] = [hibernate.IntegerType] But throws error on ...

56. List of String Class elements instead of own classes    forum.hibernate.org

This might be a simple question but I have no idea how to face it. I want a class to have a collection ( list ) of String elements. Already did the same having own classes as elements since a bunch of tutorials show the e.g. as ... Code:

57. First opbject in List is null    forum.hibernate.org

I'm fearly new to the use of hibernate.. but I have made some stuff that worked.. but now I have run into at problem that I can't solve. I have mappings that look like this:

58. Joined subclass as the child of a ordered list    forum.hibernate.org

I have a case where the joined-subclass (STRUCTURED) whose base class is Relationship participates in an ordered list of with another parent (Site). Code: |--------| |--------------| | Site | | Relationship | |--------| ...

59. Hibernate 2, SQLBase, select list alias    forum.hibernate.org

I am using Hibernate 2 against Gupta SQLBase. The SQLBase driver has a strange quirk: column names passed to ResultSet.getString(columnName) (or any of the get functions) must be upper case. In my hibernate mapping document, I specify all database identifiers (table, column etc) in upper case. Simple selects and joins work just fine. I am now running a slightly more complicated ...

60. Application crash with Hibernate 3.0.1 Query.list    forum.hibernate.org

Hi all, I am facing a strange problem with Hibernate. If any body have seen this and has any work around for the same, please let me know The problem is that hibernate causes the app server to crash instead of throwing a exception if there is a problem. Please help me sort this out. The client code: query = "from ...

61. Question on session.find() v.s query.list    forum.hibernate.org

I'm looking to get a perspective from the forum on the following question : I'm trying to figure out what the main differences are between using session.find() and using query.list(). From what I've read in the docs there doesn't seem to be an apparent difference between the two (as far as efficiency, overhead, stale data, etc). What are people using, and ...

62. One-to-many list mapping question    forum.hibernate.org

...

63. update runs before select for criteria.list()    forum.hibernate.org

Newbie Joined: Thu Sep 11, 2003 11:49 am Posts: 8 Location: Albuquerque NM Hibernate version: 2.1.8 vs. 3.0 Mapping documents: Can add if needed. Code between sessionFactory.openSession() and session.close(): Code: Criteria criteria = ThreadSession.getSession().createCriteria(RoleMenuItem.class) .add(Expression.eq("role", role.getDAO())) ...

64. NPE Thrown from Criteria.list( )    forum.hibernate.org

I occasionally see the following stack trace in my log files: Code: mil.dfas.cm.bo.PersistenceException at mil.dfas.cm.bo.org.User.getTheme(User.java:338) at mil.dfas.cm.servlet.http.Theme.processRequest(Theme.java:70) at mil.dfas.cm.servlet.http.Theme.doGet(Theme.java:55) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.netscape.server.http.servlet.WrapperFilter.doFilter(WrapperFilter.java:74) at com.netscape.server.http.servlet.WFilterChain.doFilter(WFilterChain.java:118) at mil.dfas.cm.servlet.Secure.doFilter(Secure.java:81) at com.netscape.server.http.servlet.WFilterChain.doFilter(WFilterChain.java:118) ...

65. POSITION field in collection mapping not filled    forum.hibernate.org

I can't (quickly) locate the FAQ/Article/Wiki, but I found somewhere on the site where in Hibernate 2.x list indexes are not assigned automatically and you have to do something clever in your getter like this: Code: public class DaySchedule { // Fields private int position = -1; // Some getters/setters ...

66. Using toArray(Object[]) with a property that is a List    forum.hibernate.org

I have a hierarchy that is a Composition pattern that uses the standard way in the hibernate documentation for the Bag of children. As the Composition pattern goes, eveything is a subclass of an abstract Person class. Now, I want to getChildren().toArray(new Women[0]); to get all the children that are instances of the subclass Women of Person. Only I get an ...

67. List collection problem: CGLIB exception    forum.hibernate.org

Hibernate version: 3.0 I am having an issue using List collection: Class Junk{ ... ArrayList junkUsers = new ArrayList(); /** * @return Returns the junkUsers. * * @hibernate.list * lazy="false" * table="junkuser" * cascade="all-delete-orphan" * @hibernate.collection-key * column="id" * @hibernate.collection-index * column="position" * @hibernate.collection-element * column="userName" * type="string" * length="256" */ public ArrayList getJunkUsers() { return junkUsers; } public void addJunkUser(String ...

68. Criteria query returning list of null pointers    forum.hibernate.org

69. getting list of objects    forum.hibernate.org

Hi, I am using a query like : select doc, docQuery, queryType.queryTypeDesc, user from Document doc, DocumentQuery docQuery, QueryType queryType, Iusers user where doc.documentID = docQuery.documentID AND queryType.queryTypeID = docQuery.queryTypeID AND user.userId IN (doc.indexer, docQuery.jiraIssueBy, docQuery.updatedBy, docQuery.validatedBy) AND docQuery.documentQueryID = :variable0 using the createQuery method . now for the user part in the result, the query is fetching only the first ...

70. Best way to distinct an *ordered* list?    forum.hibernate.org

(Using 2.1.7) I have a method making lists of objects distinct by using the suggested new HashSet(originalList) technique... Unfortunately when I've ordered my query in HQL, I believe I'm at risk of losing the order of my elements (since Set doesn't guarantee order). Has anyone suggested an elegant/efficient method of return a distinct List which retains the order of the original ...

71. list with join table, but join table is not created    forum.hibernate.org

The documentation says that for one-to-many association, the table attribute is ignored. In fact you don't need an extra table to map a in one-to-many relation, but only in many-to-many. The field position is added to table links because it represent the index of the list. The field linkId is IMHO misnamed, I would call it orgPageId, since it represent ...

72. Random result from hibernate query.list()    forum.hibernate.org

Hi, I have some trouble with hiberante fetching query. It is a very basic hql but it gets result randomly. Following is my code, Query query = session.createQuery("from Transaction where transactionId=:id"); query.setParameter("id", transactionId) List list = query.list(); I am sure data with transactionId is in database. The weird thing is the list I got works randomly. I have 50% chance to ...

73. Listing dodgy data    forum.hibernate.org

I'm running Hibernate over a legacy database. I'm pretty sure that I've got the mappings more or less right now - I can read valid data without problems. The problem is that the data in the database has some problems. There are occasional problems with relational integrity, and problems with data values. As soon as Hibernate hits one of these problems, ...

74. NULL entries inserted for missing elements    forum.hibernate.org

I have a with a many-to-many association. Now, under Hibernate 2.1.8 when there's an element missing (meaning there's a gap in the index column) it would not insert an entry for the missing element. When selecting, it would insert a null element into the List. Now with Hibernate 3, it wants to insert an entry where the back reference is ...

75. Mapping legacy hierarchical data (tree or self-ref. list)    forum.hibernate.org

Hello!, I'm trying to construct a mapping to legacy hierarchical data. The data uses a parent_id link to navigate from any node to the root in the tree (navigating the tree from top-bottom is not required only from bottom to top). Below is my current mapping, using hbm2ddl I'm able to generate an identical table structure as in our legacy, so ...

76. managing list of update    forum.hibernate.org

Hello, My problem is the following. I have a table which contains 2 columns : a key and a label. In my application there is a screen with a form containing all the couple [key-label] and empty input text to have the possibility to add new couple [key-label]. I would like to know if there is a way to perform automatically ...

77. Insert element in list vs update before delete    forum.hibernate.org

Hi, I have a bidirectional many-to-one relationship in a parent/child (email/recipients) table. In the parent table (email) I have a list of items (recipients). When I remove an item at the end of the list, the row is simply deleted from the recipient table. That is fine. When I remove a recipient within the list (i.e. not the last one), Hibernate ...

78. Null entry in returned List    forum.hibernate.org

Newbie Joined: Sat Nov 13, 2004 6:03 am Posts: 3 Hi, I have a parent / child object (basket and basket item). I have a single row in the BasketItem table. When I retrieve the parent basket instance, the BasketItems list is populated with 2 rows: 1) the single basket item 2) a null entry. my question is why is the ...

79. A question regarding the mapping    forum.hibernate.org

I've run into a problem with my mappings. Basically, I have a number of tables representing three-way associations. These tables consist of a surrogate primary key (organization standard) as well as three foreign keys with a database uniqueness constraint. I map these in their own file, and as their own class using many-to-one in the traditional way. However, since I ...

80. query.list() and criteria.list() and findall() ...    forum.hibernate.org

Hi all i have a simple question : with hibernate 2.1.7 when i run query.list() and findAll() ... and all methods that return a list. the return value if list was emty is a java.util.ArrayList with zero size 0; but sometime i get a EmptyList Object. and when i try to cast it to ArrayList i have a CalssCastExcetion because ArrayList ...

81. map one-to-many returning same object within list    forum.hibernate.org

Newbie Joined: Wed Apr 20, 2005 5:05 pm Posts: 12 Hello, Right to it. Here is my mapping. Code:

82. Insert an element into a list (not appending)    forum.hibernate.org

83. EventListeners - would like to have a list...    forum.hibernate.org

The current implementation of EventListeners looks like I can have only one of each type, i.e. only one postUpdateEventListener. I would like to have a list or set of postUpdateEventListeners. The reason is that we have the need to insert a history record based on data changed on multiple tables. Currently, I have a budget and budget history table. When the ...

84. mapping file for a "List" corrsponding to a "    forum.hibernate.org

I'm using Hibernate 3.0, and all my Value Object have ArrayList in them. The mapping is something like like I have a UserVO which has an ArrayList of CampaignVOs. Each user can have multiple campaigns. Hence my mapping file, when using a set is something like: What is the List ...

85. dirty session after a Query.list()    forum.hibernate.org

86. Should I use a List (or other) instead of a Set?    forum.hibernate.org

I am mapping a one to many relationship of 'Product' to 'Stock Item' (a product can have many stock items) using a Set. All saving/updating/deleting of Stock Items is done via the Product. Each Stock Item has an Integer id property, which I am using in the 'equals' method to ...

87. Bi-directional List-association with all-delete-orphan    forum.hibernate.org

Hi, from the following pages, I got the impression that Hibernate 3 now supports bi-directional one-to-many associations using Lists by setting inverse="false" on the parent and mapping the list index as a read-only property of the child: http://www.hibernate.org/193.html http://www.hibernate.org/116.html#A9 I try to use this with cascade="all-delete-orphan" declared on the parent's list property. This does eventually result in the deletion of a ...

89. Need help mapping Map w/ List values    forum.hibernate.org

Hi, I have a class which contains a java.util.Map. The Map's keys are Strings, and the values are a List of classes. The docs say that you can't map a collection to a collection, so I was wondering if there was any way to map this, as it seems like it would be a fairly common use case. The child objects ...

90. List query of a particular subtype    forum.hibernate.org

Hibernate version: 3.0.5 Mapping documents: ...

91. Using bag as un-indexed lists    forum.hibernate.org

92. Queries returns nonempty lists?    forum.hibernate.org

Version: Hibernate 3.0 I would appreciate any advice on the following code. This query returns a list with one element that is null if there are no payments for the specifed shipment. Notice that I need to check to see if the size is 1 and if the value is null and remove it so the for loop will not be ...

93. Initializing a List with the correct entities.    forum.hibernate.org

I have a User class and a Group class. Each one has a many to many association to the other through the following Sets: public class User{ @ManyToMany private Set groups; and public class Group{ @ManyToMany(mappedBy="groups") private Set users; I've also created a subclass of User called NamedUser that adds fields for firstName and lastName. Now, I've found that if I ...

94. Is it possible to map ResultSet to List of Maps?    forum.hibernate.org

A sql-query is defined as below -- Code: ...

95. Index field in collections corrupted    forum.hibernate.org

We're experiencing a very strange problem in our web application. First, here are the relevant packages we are using: spring-1.1.4 hibernate-2.1.8 ehcache-1.1 We have several hibernate-enabled domain objects that have a "displayOrder" property, which is used in conjunction with hibernate's collection feature. We have used the override-the-getter trick in the domain object, e.g.: Code: public Integer getDisplayOrder() { ...

96. Duplicate entries in criteria.list but not in query.iterate    forum.hibernate.org

I joined class A with B using left outer join where B is a Set in A. The SQL returns a result set like A.x A.y B.x B.z --------------------- 1 5 1 1 1 5 1 2 I expect 1 instance of A with a Set of 2 instances of B. Session.get() method returns correctly with 1 instance of A. Query.iterate() ...

97. Suggestion for simple feature for lists (and maps)...    forum.hibernate.org

Hibernate version: 3.0.5 Hibernate does a wonderfull job of managing index columns of a list. One possible issue, however, is that the database 'unique' constraint is not used to enforce the sort order (while logically, it is certainly unique within a particular list). So far (in my experience), I have never experienced problems with Hibernate's managing of the index column. However, ...

98. Bidirectional many to many relations using lists    forum.hibernate.org

99. Filtered lists have gaps in list-index    forum.hibernate.org

A has a list of Bs {B0, B1, B2 } with list index 0, 1 and 2. A filter is applied using session.enableFilter() to Bs whose condition evaluates false for B0 such that now A.getBs returns { B1, B2 }. Problem is that the list indices are the same as in the unfiltered case and, since Hibernate assumes list indices are ...

100. Mapping list persistence problem    forum.hibernate.org

On page 213 of Hibernate In Action is an example of what the were trying to do. However it doesnt talk about actually persisting any changes to the database. I have debugged my application and have found that an INSERT into CHILD_TABLE is not happening when an INSERT into PARENT_TABLE occurs. Also, when an PARENT_TABLE UPDATE is done, a database referential ...