List 4 « Map « JPA Q&A





1. JPA 2: In a query, how to compare the size of lists?    coderanch.com

Hey all, in a query, i wanna compare the size of two lists I have, lets say: public class school{ List pupils = new ArrayList(); } .... And now i wanna get an descending ordered list of the schools in my DB, depending on their pupils-count( => size). I believe there was a way to get the size of a list ...

2. list objects present in hibernate session    coderanch.com

Hi, I am facing a problem in an application, It creates a new persistent object and puts a reference object in it as a foreign key. But when it goes to commit the newly created object at the end (there is lot of code in between), the foreign key has been updated to null. This gives a constraint violation for not ...

3. JPA native Query - Select... where... IN, How to set list of values to setParameter()?    coderanch.com

Hi, I'm using openJPA native query defined in mapping file. I've a select query where I'm trying to pass a List of values as input parameter to it using IN clause. select... where... IN SQL works , but when I use the same query in JPA with a positional parameter, It fails.. How to pass list of values to Query?? Here ...

5. List, Bag and Set in JPA    coderanch.com

Hi I am trying to migrate some existing hibernate .hbm files to JPA annotations. Is there any way i can represent the collections, list, bag and set in JPA. I cant find any annotations corresponding to those used in the hbm files. Are there any attributes in the relationships that might help? Any ideas will help.

6. HIbernate Criteria when fired on VIEW returs list with NULL values    coderanch.com

Hi, I am using criteria query to fetch list of records from database VIEW.[code=java] I have created the corresponding HBM.xml and POJO files. OuterView.hbm.xml corresponds to OuterView.java, which contains a composite key of class InnerView.java. OuterView.java contains only one attribute as InnerView and InnerView contains all the column names and their getters and setters. I am creating criteria on OuterView.java and ...

7. List all the tables using hibernate    coderanch.com

8. How to put List in hibernate Query    coderanch.com

thanks for reading my question, i have a method , public List getTotalStudents(List studentsIdsList){ Session s=HibernateUtil.getSession(); Transaction tx=s.beginTransaction(); Query q=session.createQuery("from student "); // (1) return q.list(); } so, i want to fetch data from database based on id s in the studentsIdsList; studentsIdsList is contains all ids of students, without using any for loop to retrieve ids from the List ,how ...

9. How to Parse Multitple Entities In Hibernate NativeSQL Returned List    coderanch.com

Hi, In some of the code of my application, the Native SQL is required somehow so that I could use the xpath syntax to search a XML column in our Ms SQL database. And in the Native SQL I need to return a list with multitple entities. From the url http://docs.jboss.org/hibernate/core/3. ... l#d0e13763, I able to find a sample of adding ...





10. I want to use List in JPQL syntaxis    coderanch.com

import java.util.ArrayList; import java.util.List; import javax.persistence.PersistenceUnit; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; public class Persistence { @PersistenceUnit(unitName = "myPersistenceUnit") SessionFactory factory; public void query() { List cardIds = new ArrayList(); Session hsession = factory.openSession(); Query query = hsession.createQuery("SELECT t FROM Card t WHERE t.id IN (:cardIds)"); query.setParameterList("cardIds", cardIds); List result = query.list(); } }

11. List of entity types registered in hibernate    coderanch.com

Hi, Is it possible to get the list of entity classes registered in hibernate configuration? My problem is, I am getting Unknown Entity error while doing any operation in hibernate session. I've ensured that all the process of registering entities is properly done. Also when i give incorrect path of any entity in persistence.xml it throws an error for that entity ...

12. Persisting linked-list using Hibernate    coderanch.com

14. accessing object from List of object using JPA & JSTL    coderanch.com

Hi, I am trying to access the object from a list of objects using JSP & JSTL without any success. I'm using JPA. DvdRecord.java //list of Record private static List bRListM; //getters and setters... public DvdRecord() { EntityManagerFactory emf = Persistence.createEntityManagerFactory("DvdRecordJPAPU"); EntityManager em = emf.createEntityManager(); bRListM = em.createQuery("SELECT b.track, b.album from DvdRecord b GROUP BY b.album", Record.class).getResultList(); } Record.java @Entity public ...





17. JPA mapping, dummy list?    java.net

Now the problem is that mapping DataList also as a database table would be nothing but overhead. In the database I would like to make it look something like: [MyObject](1)-----(0..*)[Data] and map it to the above mentioned object model. I couldn't find a way to do this. Is there a way to map this using JPA?

18. How to keep indexes up to date when deleting from list?    forum.hibernate.org

Hi, I have an entity that maps a list. Everything runs fine until I remove an element from the middle of the list, then the indices are interrupted, i.e. they are not updated to their new values even though I call a saveOrUpdate() on all the elements of the changed list. The getIndex() method returns the correct value since it returns ...

19. Return a List of countries from a DB    forum.hibernate.org

Hello, I want to return a list of countries from a table. The table is simply called Countries. has one column called "country" This column lists countries How do I write a Hibernate XML file to map this column to java.util.List I cant figure it out A bag will do, I think for a i need an extra column for ...

20. Listing all objects currently associated with a Session    forum.hibernate.org

Hi guys, thanks for your help in advance I need to be able to list all currently associated objects with a Session. I keep getting NonUniqueObjectExceptions on cascades of DAOS during saves or updates. So, I figured if I implement a SaveOrUpdateEventListener and check all session-associated objects at save/update time for duplicate objects for the same row and purge/reassign them I ...

21. list-index column    forum.hibernate.org

I have a question about list collection mappings. For , does Hibernate allow a column of type VARCHAR2 to be used as the column to sort by? The column I was previously using was a NUMBER and it worked fine and then changed the column type to VARCHAR2 mapping onto a String value and it blew up.

22. Jaxb Static Class containing list mapping    forum.hibernate.org

I have the following class structure. Would really appreciate if someone can help me with the mappings. Class A { B btype; static class B { List values; List getValues(); } } I need to Map Class A to table_A and the List to table_C with one-to-many from table_A to table_C. I can create the mappings for Class A and the ...

23. Problem with object list    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message ffw-hans Post subject: Problem with object list Posted: Sat Dec 12, 2009 8:02 am Newbie Joined: Sat Dec 12, 2009 7:37 am Posts: 1 Hi at all, i have a problem with my application. There is ...

24. session.list() outputs Entity list with same values    forum.hibernate.org

I'm attempting to get a list of entities, but the returned collection contains multiple objects with all the same values. When I get the same list of just object arrays (without the "addEntity" call), the collection correctly contains all different values. When I execute the query against the database directly, I correctly get a recordset with all different values. Is there ...

25. Moving an item from one ordered list to an other    forum.hibernate.org

@OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER) @Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN } ) @IndexColumn(name = "position", base = AppInfo.BASE) @JoinColumn(name="parent", nullable=false) private List children; public List getChildren() { return children; } public void setChildren(List ...

26. List index insertation optimization    forum.hibernate.org

I am having trouble optimizing for the insertion of new list elements. For a list with an index, when I insert it and check the SQL executed, it is in two parts. INSERT INTO ... VALUE (...) <-- This doesn't set the INDEX_ORDER and UPDATE ID, INDEX_ORDER where ID = ? I am just wondering if it is possible to also ...

27. Event listeners for HQL/Criteria .list()    forum.hibernate.org

28. Check if List is empty without causing an exception.    forum.hibernate.org

Hi all, I have a problem with getting size of a list. I have two objects: Game and Team. The object Game has a List of Team objects. The first time I add a Game I did not add a Team object. When I go back to my overview page I get an Exception because I call teams.size(). How can I ...

29. Caching a one-to-many collection like a "friends list"    forum.hibernate.org

I have an application very much like a social networking "friends list". We have a "User" hibernate entity, and each User can have a bunch of other Users as their friend. This list is represented by a table in the database, whose columns are an entryid, fk_source_user, fk_target_user, where the foreign keys link to a user table. Each source user could ...

30. Persisting a List of objects containing a HashMap    forum.hibernate.org

... ... ...

31. JPQL: looking up in several list fields    forum.hibernate.org

Hi, It seems simple but I'm not able to build a query that properly describes the following case: - The class UserGroup has a list of users (UG.users) - The class C has a list of users (C.users) - The class C has a list of UserGroup (C.usersgroups) My goal is to build a query that returns all classes "C" that ...

32. List mapping broken?    forum.hibernate.org

I am using the latest version of Hibernate as of about 12/09, and every time I try to map a collection as a List, I get an error like this: Hibernate: select luoutcomes0_.ACT_ID as ACT2_1_, luoutcomes0_.OUTC_ID as OUTC1_1_, luoutcomes0_.idx as idx1_, luoutcomes0_.OUTC_ID as OUTC1_15_0_, luoutcomes0_.ACT_ID as ACT2_15_0_, luoutcomes0_.OUTC_NAME as OUTC3_15_0_, luoutcomes0_.OUTC_DESC as OUTC4_15_0_, luoutcomes0_.OUTC_ENABLED as OUTC5_15_0_, luoutcomes0_.DESCRIPTION as DESCRIPT6_15_0_ from WEBPT.PI_LU_OUTCOME ...

33. first element of the list set to null    forum.hibernate.org

34. entity-mapping for key-value attribute list?    forum.hibernate.org

Hello, I'm trying to determine if there is an annotation or mapping that I can apply to my objects in order to persist my entity. The entity contains a number of values that map easily to the database. However, the entity also contains a collection of key-value attributes that are stored in a list. The classes at listed below. The DB ...

35. ArrayIndexOutOfBoundsException when using lists    forum.hibernate.org

Hello Hibernators, I have a one-to-many mapping in my code. When I changed the mapping from a to a (because we need to order the elements, I started getting ArrayIndexOutOfBounds exceptions My original, working mapping file looks like this: Code:

36. Hibernate returns List of null objects    forum.hibernate.org

Am using Hibernate 3.3.2.GA, Hibernate Annotations 3.4.0.GA, Java 1.5 Table name - Table 1 When i retrieve the list of rows(63 total) from the Table1 the hibernate returns the List of null objects(63) whose count is same as row count of the table. Can you please point me where am i going wrong here?.

37. Exception while SessionImpl.list...could anyone help....    forum.hibernate.org

I get following exception in my code intermittently. I cant find a definite pattern to reproduce this exception . Could someone please tell me how I can avoid this. org.hibernate.AssertionFailure: possible non-threadsafe access to the session at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:100) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) at org.hibernate.loader.Loader.doQuery(Loader.java:717) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)

38. Get partial result from lazy list    forum.hibernate.org

39. how to insert list of records using hibernate    forum.hibernate.org

40. Return HashMap intead of list????    forum.hibernate.org

41. How to get java.util.List instead of PersistentList?    forum.hibernate.org

Hi all, I have a java.util.List Object 'addresses' in a 'Person' entity like this: [code] @OneToMany(cascade = { CascadeType.ALL }) @IndexColumn(name = "idxAddresses") @JoinTable(name = "person_addresses", joinColumns = { @JoinColumn(name = "person_id", referencedColumnName = "id") }, inverseJoinColumns = @JoinColumn(name = "address_id", referencedColumnName = "id")) private List links; [/code] When I load an entitiy from the database, the 'address' column is of ...

42. which to use in one to many relation Set or list    forum.hibernate.org

Set per definition cannot hold duplicate entries furthermore it does not preserve the order as its elements are not indexed. List per definition can hold duplicate entries (which for mapping relations has poor sense: associate a certain couple of objects twice over the same relation) and preserves the order as its elements are indexed. On hibernate performance I would say that ...

43. Hibernate Email List    forum.hibernate.org

44. How to map a list in an auxiliary/joined table?    forum.hibernate.org

45. How to retrieve a list via a list of ids    forum.hibernate.org

46. Hibernate HQL count without list, is it possible?    forum.hibernate.org

I believe this is HQL (could be mistaken): Code: public static int getCount(Class c) { int i = 0; Session session = SessionHandler.getSession(); try { ...

47. Mapping List of enums in JPA    forum.hibernate.org

48. How to have a list of defined objects with aggregation ...?    forum.hibernate.org

select order.id, sum(price.amount), count(item) from Order as order join order.lineItems as item join item.product as product, Catalog as catalog join catalog.prices as price where order.paid = false and order.customer = :customer and price.product = product ...

49. EJB-QL+ Seam Security Rules + data listing    forum.hibernate.org

Hy! What is the best way to listing only those entites by an EJB-QL, where the security hasPermission expression is successful. Is there something official method? I'd like to avoid this : normal query than manual selection with hasPermission with a for cycle. So, the main scenario is to get 5 entities (query setMaxResult) with the EJB-qL, where the hasPermission(entity,'rule') is ...

50. One to many, associated lists and indexing    forum.hibernate.org

51. Class list is not found in hql query "select new list(*)"    forum.hibernate.org

Hi everyone, I am using spring-2.0.7 and hibernate-core-3.3.2.GA in a J2EE web application. I would like to create hql queries such as "select new list(t.id, t.name) from Type t". When such a query is created, a ClassNotFoundException is thrown, seems because the "list" class cannot be found. The exception is thrown from within method classForName of org.hibernate.util.RefletHelper when it is called ...

52. hql to map a result list to a List in a dto    forum.hibernate.org

hello, is there a way in hql to map a result list to a List in a dto? here's an example that will show my question more clearly. assume we have a Person entity that has many Car entities. @Entity public class Person { private long id; private String firstName; private String lastName; private String address; private Set cars = new ...

53. Update a list of objects    forum.hibernate.org

Hi, I am using session.update(Object obj). This above one updates only one object. But from SQL perspective we can update many rows based on the condition. Is there a method that does the same. I know one way is to use Hibernate Query Language and then write Update statement and use executeUpdate. But as a method like session.update(). Is there any ...

54. how to bulk insert list items?    forum.hibernate.org

55. list containing only null    forum.hibernate.org

56. list of elements in hibernate    forum.hibernate.org

57. parent/child relation on same class, with list-index    forum.hibernate.org

Hello, I am new to Hibernate and trying to map a parent-child relationship with list-index, where parent and child are the same class. I have a table with nodes and one with relations between nodes (childid, parentid, entryposition). Nodes can have more than one parent. I tried the following mapping: Code:

58. query.list() blocking? JBoss vs Tomcat?    forum.hibernate.org

59. 2cd level cache ! working with List on restart of hibernate    forum.hibernate.org

Author Message SGlimpff Post subject: 2cd level cache ! working with List on restart of hibernate Posted: Wed May 05, 2010 4:39 pm Newbie Joined: Thu Apr 29, 2010 11:52 am Posts: 3 Tested with hibernate 3.2.6 and 3.5.2 Final I have a hierarchy of objects where the base class has a List of base objects. This is represented ...

60. inserting a new row into a list hibernate query    forum.hibernate.org

Hi I have a object A which has one many relationship with object B. A->Student, B->ConcentrationPlan now if I add a new concentration to the list. I do the following in terms of code selectedStudent.getConcentrationPlan.add(concentrationPlan); studentDao.flush(); loadConcentrationPlans(); selectedStudent is of type Student. It will get the list of Concentrations for a Student. And adds the new one to the list. After ...

61. Unknown Column Next_Hi in Field List - NOT using HiLo Gnrtr!    forum.hibernate.org

Hello friends - I'm having the darndest time figuring out what I'm getting this error: ****************************************************** 15:27:41,687 ERROR TableGenerator:104 - could not read a hi valuejava.sql.SQLException: Unknown column 'next_hi' in 'field list' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625) at com.mysql.jdbc.Connection.execSQL(Connection.java:2297) at com.mysql.jdbc.Connection.execSQL(Connection.java:2226) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1812) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1657) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:94) at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:774) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:747) at us.fl.ci.tlh.mobile.persistence.WorkorderDao.insertWorkorder(WorkorderDao.java:1688) at ...

62. Looping through a List    forum.hibernate.org

Hi I'm new to this. I have a Person object with a List of dogs of type Dog. I'm successfully getting the Person I want and accessing all their dogs from the List. 1. I'm using the id column as the index, and I've just realized that unless the List of dogs contains ids sequentially, starting with 0, I get an ...

63. Hibernate comope-id list empty    forum.hibernate.org

Newbie Joined: Thu May 27, 2010 10:57 am Posts: 1 I'm using Eclipse ide Jboss Tool. I had created with the wizard the following file: EsbCommonlog.hbm.xml ...

65. Mapping a List    forum.hibernate.org

I have an association mapped as a List. There's a column in the table that the List data comes from, specifically for indexing the List. However, as records are deleted, the index in the List becomes sparse. Eg 0,1,4,5 When this happens the List can no longer be sorted using Collections.sort. I've tried creating another ArrayList and populating in from the ...

66. Error with mapping a List    forum.hibernate.org

67. @OrderColumn and huge list of items    forum.hibernate.org

70. Mapping a simple non-changing list of values    forum.hibernate.org

In the meantime I created a Role mapping with a property called RoleName that refers to a RoleName enum. I added unique="true" to prevent duplicate Role entries in the database. Code: ...

71. Criteria.list() consistently returns stale data.    forum.hibernate.org

The Hibernate manual says that Query.list() is guaranteed not to return stale data. Is this also true for Criteria queries? I am consistently getting stale data from Criteria queries with Hibernate 3.5.2Final executing against SQLServer 2005. The problem happens when users in different JVMs execute a list query, and then one of the users modifies one of the returned objects, and ...

72. mapping a list of hashtables and visa versa    forum.hibernate.org

73. List index behaviour    forum.hibernate.org

Hi, I have one easy problem, but I find a way how to solve it... I have two entities... Category and ArticleCategory, Category has a list of ArticleCategories Code: @Entity public class Category extends AbstractBusinessObject { /** * */ private static final long ...

74. Map Boolean[] or List to single field in MySQL    forum.hibernate.org

Hello all, After googling a lot and searching through this forums I haven't been able to find a simpler answer to the question in the subject but to use a UserType. Is there a simple way of mapping a Boolean[] or List (I don't mind as long as it is an ordered collection) to a single field in a MySQL 5+ ...

75. one to one relationship with List    forum.hibernate.org

Hi, I have two classes Sale and SalesUnit. Sale class have a list of SalesUnit. Sale and SaleUnit has a one to one relationship. Can anyone tel me how to Map this relationship? I couldn't find anything like this on the web.. Sale class Code: public class Sale { private Long id; private ...

76. Most efficient way to lookup list entry in 1:many relation    forum.hibernate.org

I have an entity (EntityA) that contains a list of other entities (EntityB) - it is a 1:n relationship using an association table with a sequence field to record the order. Both entities have a compound key. The association is lazily loaded. Given that I have the key of the EntityB that I want to retrieve from the list contained within ...

78. How to access the list in entity while building criteria qry    forum.hibernate.org

Hello All, I'm new to this hibernate world. I managed to understand a little bit about creation of criteria queries. Now i have a problem: " How to access the list present in hibernate entity while building criteria query ? " My Entities Code: @Entity @Table(name = "SERVICE_ORDER_TELE") public class ServiceOrderTele implements java.io.Serializable, DbEntity { private static final ...

79. Hibernate cache and indexed lists    forum.hibernate.org

80. NamedQuery and list elements to where clause in hashmap    forum.hibernate.org

Hi, i have a problem with a query. I need compare a List of String in the WHERE IN clause but i dont have results: I have this code in java: .... String[] codes = {"CODE_A", "CODE_B"}; HashMap whereClause = new HashMap(); whereClause.put("codes", codes); List result = getObjectPersisterService() .executeNamedQuery("findDataUsingNamedQuery", whereClause); In my namedQuery.xml file i have:

81. Find with Criteria/Example: object containing a List    forum.hibernate.org

hi, i am trying to execute a find using Criteria/Example on an Entity that contains a List of enum. consider a class such as: @Entity public class MockEntity extends ModelBase implements Serializable { @CollectionOfElements() @Enumerated(EnumType.STRING) private List mockEnums; ... } here, the enum is defined as: public enum MockEnum { GOOD, BAD, OTHER; } i am trying to find MockEntity objects ...

82. multiple container lists problem    forum.hibernate.org

Hey Guys, Just been frustrated, day after day with a question. Supposed we have something like this. class Cat{ ... List mice; List toy; ... @OneToMany(cascade=CascadeType.ALL) public List getMice() { return mice; } @OneToMany(cascade=CascadeType.ALL) public List getToy() { return toy; } } Now say I wanna do a criteria query in order to get a cat with id 1 ...

83. Hibernate: cant get the associated List retrieved    forum.hibernate.org

Newbie Joined: Tue Aug 24, 2010 7:24 am Posts: 8 Hi An entity X has a list of entity Y and the entity Y has an instance of entity Z. The relation between X to Y is OneToMany and the relation between Y to Z is ManyToOne. I want to retrieve X and have all the associated entities retrieved with them ...

84. mapping sting to a list of value    forum.hibernate.org

85. Persistence manager and list of managed objects    forum.hibernate.org

Hi I'm looking for a document describing the behavior of persistence manager in examples. I can see in every moment list of persistent objects managed by persistence manager. I try session.getPersistenceContext().getEntitiesByKey(); but result is not what I expect (in use case load, create new, persist, update, delete). Can you point me how to obtain list of managed objects in session? Best ...

86. Mapping a map with a List element    forum.hibernate.org

Newbie Joined: Wed Sep 01, 2010 7:33 pm Posts: 1 I am trying to map the following object but when I try and merge I get a classCastException because it tries to find the identifier on the list not the element of the list. Any suggestions would be appreciated. Code: public class Object1{ Long oid; ...

87. Stopping Hibernate from running SQL DELETE on list elements    forum.hibernate.org

The following Hibernate mapping shows that I have an Item class that contains a one-to-many set of Field classes, which contains a list of string values. The Item objects are held in the items table, the Field objects in the item_fields and the string values in the item_field_values table. ...

88. Column found in more than one FROM list table.    forum.hibernate.org

Author Message stevekvifm Post subject: Column found in more than one FROM list table. Posted: Thu Sep 16, 2010 2:57 am Newbie Joined: Thu Sep 16, 2010 2:38 am Posts: 3 Hi guys, Need some help, I've been battling this for days. I have 2 tables: "Item", "Log" (this is a one-to-many relationship) Now the entity beans look like ...

89. Getting sublist from huge List    forum.hibernate.org

90. createSQLquery().list() returns strange values    forum.hibernate.org

I use Hibernate 3.3.2 GA with MySQL 5.1. I try to use session.createSQLquery(string SQL).list(), but can't get right answer back. I find the problem may be caused of db table schema. We have a db table named stock_info includes CODE and PRICE two fileds and contains 100 records inside. For example {(1001, 10.8), (1002, 2.5), (1003, 4.7), ... }. SQL script ...

91. Execution hangs on method size() of criteria.list()    forum.hibernate.org

Newbie Joined: Mon Mar 22, 2010 6:57 am Posts: 6 Please help. Code: Branch branch = branchDAO.read(40001); List byBranch = testBaseSpringHibernateDAOImpl._readAll("branch", branch); assertEquals("8. Entry branch match failed.", 1, byBranch.size());//hangs Code: protected List _readAll(String ...

92. Query returning a map of grouped list    forum.hibernate.org

93. Map> mapping - how to?    forum.hibernate.org

Newbie Joined: Mon Oct 18, 2010 9:35 am Posts: 10 Hi to all, I have a case where I need to map property that looks like this: Code: private Map> colorSizesMap = new HashMap>(); I was searching through the forum and there are a lot of unanswered posts of this type, except one where they forward to this url. ...

94. Hibernate version getting updated on query.list()!    forum.hibernate.org

Hello, This is happening when ejb service call is made via HttpRequest post method to get Objec A. Once this ejb service is invoked, the control goes to the backend and Object A is retrieved. While in the backend another call is made to query more objects in the same ejb session. I noticed when the query.list() is called to get ...

95. One-to-Many not populating objects when a List is returned    forum.hibernate.org

I have an issue when trying to load a one-to-many relationship when a List of objects are returned. I'm using a join table named article_image between my article table and the image table. tables: article(article_id) image(image_id) article_image(article_id, image_id) Code: @Component @Entity @Indexed @Table(name="article") @FullTextFilterDef(name="notActive", impl=ActiveArticleFilterFactory.class) public class Article implements java.io.Serializable { @OneToMany(cascade = CascadeType.ALL,fetch=FetchType.EAGER) @JoinTable(name = "article_image", ...

96. Find out list of managed entities for persistence context    forum.hibernate.org

Hello, Is there any way to find list of all managed entities that belong to given persistence context? In my application there are several modules, each having its own persistence.xml and managing different set of entities, thus resulting in several EntityManagers (ie. Sessions in hibernate terms). Then there is main block of code which uses these modules, however if I want ...

97. List all named queries available    forum.hibernate.org

98. How to make a join using hibernate based on id's list    forum.hibernate.org

Hello all, I have a question regarding join between 2 entities using hql. Starting on a userProfile, I have to retrieve the name of the role associated to this userProfile. So I need to make a join in order to get it in the role table. I have the following class UserProfile : Code: @Entity @Table(name="USER_PROFILES") public class UserProfile extends VersionedObject ...

99. HQL Query.list() is returning proxy    forum.hibernate.org

select cell from AcqDmProdField dmprod inner join dmprod.acqCmpCell cell inner join cell.segment seg inner join seg.version ver inner join ver.campaign cmp where (cmp.campaignNumber= :campaignNumber and dmprod.productionContact = :prodContact) and ver.status = :statusActive And the relationships are as Follows: AcqDmProdField < -> AcqCmpCell (One-to-One) AcqCmpCell <-> AcqCmpSegment (Many-to-One) AcqCmpSegmet <-> AcqVersion (One-to-One) AcqVersion <-> AcqCampaign (May-to-One) Now when I execute query.list() I ...

100. List I mapped returns wrong class    forum.hibernate.org

Hi We are making simple mmorpg for fun. Right now inventory mappings are bugged somehow, because List items returns Inventory object and not ItemSlot object (how is this even possible o.o). I have Inventory.java that contains all inventory items and way to get them: Code: @Entity @Table(name = "aegis_inventory") public class Inventory @Column(name = "item_owner") @Id ...