List 12 « Map « JPA Q&A





1. nulls in my query list with reverse engineered database    forum.hibernate.org

Newbie Joined: Thu Mar 01, 2007 4:13 am Posts: 4 Hi, I have an issue with hibernate when trying to extract data from a reverse engineered table. When I query all the contents of the table with a simple HQL from TABLENAME most of the items in the list are null. The only ones that are not returned are the ones ...

3. Two Lists, same type...    forum.hibernate.org

Hibernate version:3.2.6 Hi, Ok, I'm quite new to Hibernate so please excuse me if I am missing something fundamental... So I have a class "MarketSnapshot" which contains two lists of another class "PricePoint"... one for bid prices, one for ask prices... my mapping document looks something like this: ...

4. order by or list indexes in an associated table    forum.hibernate.org

Is my request really so exotic that hibernate is not able to do this? lol In fact, I was expecting to find a way to add an extra column in the select that hibernate generates, so that I may reference this column in the order by clause. But I couldn't find how to do this. Does someone already had such a ...

5. Mapping a map with List values    forum.hibernate.org

6. Saving a generated in memory pair list    forum.hibernate.org

I have a simple entity object: @Entity @Table public class Equipment { @Id @GeneratedValue @Column(name = "EQUIPMENT_ID") private int equipmentId @Column private String name } The way I am going about this is I am storing a list in memory of these objects (incrementing the id every time one is added). At the end I save to the database. This works ...

7. Change order insert delete when modify a list    forum.hibernate.org

Hi, I have a problem when I save an object with a list of object mapped. I change the elements of this list (remove some objects and adds another ones) and then I save the parent object. When I save the parent object Hibernate first make INSERT SQL into database in order to save new objects which I have added into ...

8. How to save a list of enum object?    forum.hibernate.org

9. Is there a way to put an Order object in a Criterion list?    forum.hibernate.org

Here's an example of how I use the HibernateCriteria API to order a query result based on a property of a Java class for which I am querying: [url] User user = new User(); Session session = HibernateUtil.beginTransaction(); Criteria criteria = session.createCriteria(User.class); Order order = Order.asc("loginName"); criteria.addOrder(order); List results = criteria.list(); HibernateUtil.commitTransaction(); for (int i = 0; i





10. One Shot Delete with an unmanaged list    forum.hibernate.org

11. DetachedCriteria query returns correct count, but empty list    forum.hibernate.org

Newbie Joined: Tue Jul 15, 2008 8:42 am Posts: 2 Hibernate version: 3.2.6ga Mapping documents: ...

12. list() returns more than one instance of entity    forum.hibernate.org

Hi, I have found that if the mapping contains components in a bag container with fetch=join, the method list() returns a list with more than one instance of the same entity under some circumstances. The example below contains two classes, Parent and Child. The Parent contains several Child objects. The Parent is an entity, but children are components (not entities). Hibernate ...

13. How to Persist an Array of List Objects and their children    forum.hibernate.org

I have a question that I am trying to solve in applying Hibernate/Annotations, is it of one-many and many-many associations or something else. If I have three classes that I want to persist: The top class is e.g., 1) SimModel - only one of these exists during run time. second class 2) PlatformList - -- public class PlatformList extends LinkedList {.. ...

14. Hi.. mapping a list is not saving the items    forum.hibernate.org

Hi! First of all i'm quite new on Hibernate, and I have a little problem and I wish to know what I'm doing wrong. I have mapped a tipical week entity relationship (say Order - Items) with a list on hibernate: Here is my Order class: Code: //This class is abreviated for this sample public class Order extends AnotherClassWithId{ ...

15. query list casting help needed    forum.hibernate.org

16. One to many relationship from entity to list of value object    forum.hibernate.org

Hibernate version: 3 Name and version of the database you are using: Sybase ASE 12.5 For a couple of days I've been trying to map the following object model: Code: @Entity @Table(name="forms2") public class Form { @Id private int id; @Version private Long rowVersion; ...





17. list-index column not updated on delete    forum.hibernate.org

Hibernate version: 3.2.6 MySQL version: 5.0.51a-community-nt I'm having a problem with Hibernate not maintaining the list-index column in a many-to-many relationship. I've reproduced the problem in this simple test case: I have a many-to-many relationship between Gang and Biker (I know: in real life, a biker would never belong to more than one gang; please suspend disbelief ;) The Gang side ...

18. How best to Cache Criteria Lists using the 2nd level cache    forum.hibernate.org

I am creating a criteria that returns a list of Order objects the were generated for a specific user on a given day. The day the order was placed and user an order belongs to is immutable. I am trying to figure out how to use Hibernate's 2nd level cache to the cache resulting list from calling Criteria.list() My current search ...

19. dropdown list populate    forum.hibernate.org

private void buildInstrOptions(){ List teacherList=null; try{ Session session = HibernateUtil.getSessionFactory().getCurrentSession(); Transaction tx=session.beginTransaction(); ...

20. Getting a list of values behind a intermediary table    forum.hibernate.org

Hibernate version:3.2.5 I'm having trouble to map a list of values, bag with element. This is the situation in DB: t_actor: actor-id t_actor_vs_roles :actor-id,role_id t_roles: role_id,role_name Now I want to map an ActorDTO which has a list of role. role is from an enum Role I can't find a way, example of how to map this. I tried with a formula ...

21. Problem with list mapping    forum.hibernate.org

Newbie Joined: Wed Sep 10, 2008 10:42 am Posts: 2 I am having problems with a list with one of my projects, and it is really starting to annoy me. I have tried searching the forums, but have come accross nothing. Any help will be really appreciated. The context is that I have a user object, which I want to record ...

22. How to use filters and bind list to the session - namedQuery    forum.hibernate.org

Newbie Joined: Fri Dec 07, 2007 4:25 pm Posts: 6 HIi all, i want to use a filter so i added the filter def and the filter and set the parameter value as below. but i am confused as if i apply the filter and then query using the hibernate template then the filter criteria is never applied. Code: Session session ...

23. How to use filters and bind list to the session - namedQuery    forum.hibernate.org

Newbie Joined: Fri Dec 07, 2007 4:25 pm Posts: 6 HIi all, i want to use a filter so i added the filter def and the filter and set the parameter value as below. but i am confused as if i apply the filter and then query using the hibernate template then the filter criteria is never applied. Code: Session session ...

24. Bi-directional List not re-ordering and duplicated position    forum.hibernate.org

I try to remove update="false" becomes : It worked! The list POSITION can be successfully re-ordered. BUT , every time I insert a list of objects , I noticed Hibernate first insert and then update... If I insert 100 albums , there will be 200 SQL commands executed. I feel this is a very ...

26. How would I map a List collection stored within Map values    forum.hibernate.org

I tried something very similar and could not make it work. I had to create a separate class to contain the list of entities. Here are the details. Java private Map fieldAssociations = new HashMap(); Mappings ...

27. running criteria queries many times returns empty list in h2    forum.hibernate.org

I am trying to use a local persistence engine such as H2 or HSQL and I ran into a problem during testing. Whenever I do a criteria query I get the correct results. However, if I then perform the same query back to back the second returned list is always empty. example : //this list will contain the correct data: List ...

28. iterate() or list(), which is efficient for performance    forum.hibernate.org

Regular Joined: Wed Oct 15, 2008 6:59 am Posts: 103 Location: Chennai Code: public String[] checkSecurityCode(String code){ String[] result = new String[8]; BaseHibernateDAO dao=null; try { dao= new BaseHibernateDAO(); session =dao.getSession(); ...

29. Many to Many with List problem    forum.hibernate.org

I was following the Person/Event example in the documentation. One thing I noticed was that when adding a new event to a person, it fetched all of the existing events linked to the person. After doing some searching, I found that this is expected behavior with Sets. So I switched it to a List but its still fetching the existing data. ...

30. JPA problem with Lists and Inheritance types...    forum.hibernate.org

select classtimet0_.userID as userID1_, classtimet0_.TtID as TtID1_, classtimet1_.TtID as TtID1_0_, classtimet1_.disabledText as disabled3_1_0_, classtimet1_.PortalURL as PortalURL1_0_, ...

31. problem with list when rearranging    forum.hibernate.org

Class A has a child list specifying an association to another class B. Table A Table B Id Id Table C(Association Table with 3 columns) AId(Id of Table A) BId(Id of Table B) SeqNo When I was trying to rearrange the child list, obviously an index will be changing. For example, the list I have orignally was Original java and persisted ...

32. list discrimiator values in a select box    forum.hibernate.org

Hi I have a class and a subclass which uses a discriminator in order to differentiate between the two classes. I want to get the list of all possible values of discriminator column. So, I have a class:

33. Using to List to output query results    forum.hibernate.org

Newbie Joined: Thu Nov 13, 2008 11:37 am Posts: 3 Hi: The query string is returning a list which I am trying to display using System.out.println but I am unable to do so. Can someone please help. I am trying to access the list using the following code, the list size is correct as per the database, I verified it, but ...

34. Out of memory while fetching data in query.list()    forum.hibernate.org

Hibernate version:3.0 Name and version of the database you are using: HSQL in server mode I am having a very large input data file of about 100,000 records and I need to operate for each record. I first tried the easiest method to call query.list() but at this line I was getting out of memory. So I changed my code to ...

35. delete objects in list when updating    forum.hibernate.org

Hi I am a newbie to hibernate and I'm using hibernate annotations for my project. The entity classes are as follows Code: @Entity public class Artist { Integer artistId; String artistName; ............ List albumList; @OneToMany(mappedBy = "artist", cascade = CascadeType.ALL) public List getAlbumList() { return albumList; } @Id ...

36. List not returning null but has size 0    forum.hibernate.org

I thought that the list() function used on a query should return null if no records was found. We have som cases where it does not return null, but the list.size() returns 0. This means that we have to check both for null and size=0 after queries. Is this correct? String myQuery = "from myTable mtable where colA = :queryParam"; List ...

37. Criteria.list() hanging    forum.hibernate.org

Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message davout_uk Post subject: Criteria.list() hanging Posted: Tue Dec 02, 2008 4:16 pm Regular Joined: Tue Apr 10, 2007 10:02 am Posts: 50 I have a DAO tier implementation that is using Hibernate and the Criteria object ...

38. Unnecessary List-method calls in PersistentList.readFrom    forum.hibernate.org

Hibernate version: SVN Revision 14993 Name and version of the database you are using: MySQL 5.0.24 In the method readFrom in the class PersistentList every time an element is added, the for loop responsible for the padding adds a null element and this null-element is then replaced with the actual element. In the case when the List loaded with Hibernate hasn't ...

39. Problem with ordered list mapping    forum.hibernate.org

So, I'm migrating an application from Hibernate 3.2.6.ga to Core 3.3.1.GA and Annotations 3.4.0.GA, largely so we can use annotations and move away from mapping files. I have a bidirectional one to many relationship where the many side has a sequence number column that serves as the index for an ordered list. The sequence numbers should start with 1 in the ...

40. select twice while fetching a list, despite inner join    forum.hibernate.org

Newbie Joined: Mon Dec 15, 2008 1:32 am Posts: 3 [Running Hibernate 3.3.1 ] I am working on an app, I fetch a list of ItemPosts using a Dao, meaning a collection is returned. The challenge now is the collection returned contains an initialized item property. i.e The ItemPost list contains ItemPosts whose item property have been initialized. but When i ...

41. Query.list returns old view of data    forum.hibernate.org

Newbie Joined: Sun Dec 21, 2008 8:24 pm Posts: 2 Hibernate version: 3.2.5. Also tried 3.3.1. Problem: I have a woodstock table on a JSF page with the ability to add and delete records. This works fine and the database is always correct. However hibernate queries return random states in which the data was at. To recreate I navigate to the ...

42. Nulls in return list    forum.hibernate.org

I have a very simple hibernate class with an id class that contiains four variables. I am using createcreria like below. If I run the sql that is printed in the log, I get six rows. Two rows contain a null value in one of the id variables. (which should be fine). The return list contains six items, but two of ...

43. list index column updated with null when moving associations    forum.hibernate.org

Author Message apptaro Post subject: list index column updated with null when moving associations Posted: Mon Dec 29, 2008 11:04 am Newbie Joined: Thu Oct 05, 2006 3:26 am Posts: 4 Summary: List index column is updated with null when moving from one list to another list of different class, thus following query results in org.hibernate.HibernateException: null index column ...

44. List versus Set with @ManyToMany    forum.hibernate.org

45. How to store list of objects using hibernate    forum.hibernate.org

If by List, you mean that you want to maintain an order then use Use "List". If you don't need to maintain order use Set. Note index element with column attribute. The mapping file below is used to create a Flight object with a "list" of Airport (Leg) objects. Code: ...

46. How to persist a list of enums    forum.hibernate.org

Hi everyone.. How can one persist a list of enums using hibernate..When I try to do so I get this error.. Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(exteriorFeatures)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253) at org.hibernate.mapping.Property.isValid(Property.java:185) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440) ...................... following is the line of code List exteriorFeatures = new ArrayList(); and this is the enum definition public enum ...

47. Creating linked lists, trees, etc. using an interface?    forum.hibernate.org

Here is a simple question: I want to implement a linked list (or a tree or similar) using an interface (actually a trait as I'm coding in Scala) on the individual entity. In other words, if I have an entity ToDoItems and I want to make it a linked list, then my desire is to simply add a LinkedList interface which ...

48. list-index being set to null    forum.hibernate.org

Hibernate version: 3.2.6 Name and version of the database you are using: Oracle 10g Hello, Im having trouble with a mapping where Im not getting the list-index set. The index is always null. Can someone see what is wrong with this mapping: (and I'm only including what what I think is needed because I can't copy/paste--I have to retype this because ...

49. How to persist a list using JPA and hibernate    forum.hibernate.org

Hi, I am using Spring , JPA and hibernate.. 1) How can one persist a list of objects? 2) Is it possible to persist a list of enums ? I am getting these exceptions : a) org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(features)] when I define field as List features; // property feature is defined with @Entity b) ...

50. List-index not combinable with on-delete="cascade"    forum.hibernate.org

Hello, The problem is the following: If i want my mapping to make hibernate handle the list-index, i have to remove inverse="true" and on-delete="cascade" in But, if I remove inverse="true" and on-delete="cascade", hibernate doesn't apply an on delete cascade on the foreign key. Another guy with the same problem hacks in the hibernate source and changes Mappings.Collection.validate() -> http://lists.jboss.org/pipermail/hibern ...

51. Criteria Query returning duplicate results in child list    forum.hibernate.org

Hibernate version: 3.3.1 Hi, we have an object structure that looks like this: ProdTypes have multiple attributes (List) Attributes have multiple AttributeValues (List) We are creating a criteria query like this: crit.add(Restrictions.eq("prodTypeId", id)) .setFetchMode("attributes", FetchMode.JOIN) .setFetchMode("attributes.attributeValues", FetchMode.JOIN) .setFetchMode("attributes.xmlTags", FetchMode.JOIN) .createCriteria("attributes", Criteria.LEFT_JOIN).add(Restrictions.isNotNull("attributeValues")) .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); We are getting back the correct number of ProductTypes, but the Attribute List has many duplicate records. Is there ...

52. How to map a list inside element.    forum.hibernate.org

Hi I am using table per class hierarchy with discriminated column So I need to map subclass using element, and member of subclass will be mapped using , but what can happen when we have list as a member in subclass. so I got stuck here that how to map list inside element , so if any one knows ...

53. suggestion list for a hibernate search string    forum.hibernate.org

Hi every one I am using hibernate search in my project. And also I need to use the richfaces suggestion box as search text box in my view page. So the suggestion shows all the matches when the user type first few characters. i need the search result for suggestion box is from list of indexes form index directory. So how ...

54. SQL query session.createSQLQuery.list(),JDBC type:101 except    forum.hibernate.org

Hi i am simply executing an SQl query using session.createSQLQuery.list(), in hibernate. The query is a simple select query. But i getting the following error, Exception in thread "main" org.hibernate.MappingException: No Dialect mapping for JDBC type: 101 at org.hibernate.dialect.TypeNames.get(TypeNames.java:56) at org.hibernate.dialect.TypeNames.get(TypeNames.java:81) at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:370) at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559) at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:485) at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:501) at org.hibernate.loader.Loader.getResultSet(Loader.java:1796) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) ...

55. probleme List methode find    forum.hibernate.org

Author Message chady Post subject: probleme List methode find Posted: Wed Jan 28, 2009 8:38 pm Regular Joined: Wed Jan 28, 2009 8:31 pm Posts: 54 Hi I start with hibernate this is my error Code: 19:49:33,860 DEBUG SessionImpl:1828 - Dont need to execute flush [B]19:49:33,860 DEBUG QueryTranslator:207 - HQL: select from ca.croixbleue.qc.model.base.BaseAvinfoge as base where base.noDossier ...

56. Mapping a bidirectional list not working as documented?    forum.hibernate.org

@Entity public class Parent { @Id @GeneratedValue private long id; @Version private int version; private String name; @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name = "parent_id", nullable=false) @org.hibernate.annotations.IndexColumn(name = "parent_index") List children = new ...

58. How to query with HQL on annotated list getters?    forum.hibernate.org

@Entity class Parent extends BaseParent { @OneToMany(cascade = {CascadeType.ALL}, mappedBy = "parent") public List getChildren() { return super.children; } public void setChildren(List list) { super.children = list; ...

59. Need to persist a Map>    forum.hibernate.org

60. HQL to get the index of an object in a result list?    forum.hibernate.org

It has come to my attention that I might be able to retrieve my query result list as "extra-lazy", and then find out the index of an item in that result list using indexOf(). However, I cannot figure out how to specify that my HQL result list items should be "extra-lazy". (I do see how an object's collection can be extra-lazy ...

61. Removing item from a List does not persist    forum.hibernate.org

I am having trouble when removing an item from a list. The list is defined in a superclass, but the Hibernate annotations are applied to property accessors in a subclass. There are two methods in the superclass that manipulate the list. The "add" method works fine, but the "remove" does not persist changes. I have checked my Cascade settings, and I ...

62. Intializing the list of a detached object before updating    forum.hibernate.org

Hi! Given objects my.domain.ObjectA and my.domain.ObjectB. They have a many-to-one relation, where ObjectA contains a List of ObjectB, and ObjectB contains a reference to ObjectA. It's mapped like this: Code:

63. Mapping of a list with jdk types    forum.hibernate.org

Hi, I'm trying to map a list of Long objects in a class. For example, public class Foo { private List numbers; } I wrote the mapping in hbm as follows: When i run the code, i get the following exception saying that java.lang.Long is not mapped: Invocation of init method ...

64. Should we new a List?    forum.hibernate.org

As far as i know this only makes a difference outside the persistence context, as soon as you access the collection inside a session you will always get a least an empty list, never null. So it's up to you, but i would suggest going one way or the other for code consistency.

65. Query.list() by-passes the second-level cache?    forum.hibernate.org

// This loads the ids from DB and the entity from 2nd level cache Iterator i = session .createQuery("from User where org='foo') .setMaxResults(100) .setFirstResult(1) .iterate(); while (i.hasNext()) { User u = (User) i.next(); }

66. Hibernate Issues update statement on criteria.list();    forum.hibernate.org

Newbie Joined: Thu Mar 19, 2009 4:47 am Posts: 8 Following is the code: public List getDCList(String selectionCriteria, HttpServletRequest request) { Transaction tx = null; List ar = new ArrayList(); String startDate = (String)request.getParameter("startDate"); String endDate = (String)request.getParameter("endDate"); String[] startDateArr = startDate.split("/"); String[] endDateArr = endDate.split("/"); ReportDC reportDC = null; try { Session session = InitSessionFactory.getInstance().getCurrentSession(); tx = session.beginTransaction(); System.out.println(startDate); Criteria ...

68. Listing the Classes Used    forum.hibernate.org

69. Listing the Classes Used    forum.hibernate.org

70. Empty List when retreving from Database    forum.hibernate.org

Newbie Joined: Tue Apr 07, 2009 8:48 am Posts: 14 Location: Kerala,India hi all, when i try to retreive from data base it is returning an empty list. i am using Oracle 10g db. i have two tables namely CRMACCOUNT and CRMUSER and java classes for them Crmaccount.java and Crmuser.java. i have a main class AccountDAO in which i try to ...

71. problem mapping a List    forum.hibernate.org

@OneToMany(targetEntity = com.xxx.RelationTarget.class, mappedBy = "relation", cascade = {CascadeType.REMOVE, CascadeType.PERSIST }) @OrderBy("sequence") @org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN) public List getTargets() { return _relationTargets; ...

72. List Members in Where Clause    forum.hibernate.org

Suppose I have the following classes: class Foo { @OneToMany List bars; } class Bar { String s; } And I want to write a method like this: List getFoosContainingAny(List keywords) The purpose here is to retrieve any Foo f such that a Bar b in its list satisfies: keywords.contains(b.s) I'm not sure how to express this in HQL, but I ...

73. List contains objects not Dept objects??    forum.hibernate.org

This is my code List tempDepartments = new ArrayList(); tempDepartments = session.createQuery("from Dept").list(); for(Dept d : tempDepartments) { departments.add(new SelectItem(d.getDept_id(),d.getDept_name())); } the error that Iam getting is that it says that the line (for(Dept d : tempDepartments)) contains incompatible types [javac] found : java.lang.Object [javac] required: com.timekeeper.model.Dept [javac] for(Dept d : tempDepartments) okay now Iam using: List tempDepartments = new ArrayList(); ...

74. How to get retrive the data from quer.list()    forum.hibernate.org

Hi I am not able to retrive the data from Object[]. Below is the code StringBuffer q = new StringBuffer("select T.CLI_ID, " + "T.CLI_ADDR_TYP_CD " + "from " + " TABLE T, TABLE2 T2" + "where " + "T2.cli_id = T.CLI_ID " + "and " + "T2.id='100'); query = session.createSQLQuery(q.toString()); List plist = query.list(); Object obj[] = (Object[]) plist.get(0); if (obj ...

75. Criteria against property List Size    forum.hibernate.org

76. Subclasses referencing the same list causes problems    forum.hibernate.org

I have the following schema in my hbm.xml file ...

78. Get one-to-many Related Object List Using Criteria    forum.hibernate.org

Hi. I have two objects which one of them is Person.class, and another one is PhoneNumber.class. There is a relationship between Person and PhoneNumber and a person may have more than one phonenumber. Their relationship is linked with this; Code: ...

79. calling query.list method seems to lockup    forum.hibernate.org

Hi, I'm trying to call the query.list() method, which I do throughout my application, and it seems to work fine. However, in this one bit of code, it works fine for 2 or 3 times, and then seems to lock up for some reason. I can't tell where it's actually locking in the Hibernate code b/c I'm not sure what class ...

80. Long parameter list & Hibernate performance    forum.hibernate.org

I have to run a query against MySQL DB in order to retrieve some data. Let's say that we have the following table: ID | COLUMN_1 | COLUMN 2 ---+-----------+----------- 1 | AAA | BBB 2 | CCC | DDD ... and the query should look like this one: select * from TABLE where (COLUMN_1 = AAA and COLUMN_2 = BBB) ...

81. Create One-To-Many relation with List Index in JPA    forum.hibernate.org

Hello, I'm developing EJB3 application with Hibernate 3.4.0GA. I would like to have an entity name Process which has ordered list of Activity entities. First question is does the JPA spec support ordered list, meaning persist the list index to the database? Second question is if not, can I use Hibernate specific annotations to get around it? Any other idea is ...

82. Invalid MySQL syntax when using 'select new list()'    forum.hibernate.org

Hibernate version: 3.3.1 GA MySQL Version: 5.1.34-community JDBC Connector: mysql-connector-java-5.1.7 Dialect: org.hibernate.dialect.MySQL5InnoDBDialect I have a HQL query that looks like this: Code: select new list(ca.receivedTransactions, ca.sentTransactions) from CustomerAccount ca where ca.customer.customerId = :customerId Where receivedTransactions and sentTransactions both are of type A or B both inheriting (EJB3 single-table style) from Transaction. CustomerAccount is inheriting from TransactionAgent. (This should explain the quirks ...

83. Is it possible to have a Map> ?    forum.hibernate.org

Is it possible persist a map where the key is an entity and the value is a list of entities? Or do I need to invent a wrapper class to replace the list and persist that? private Map> purchasesByCustomer = new HashMap>(); I've tried this, but I'm just guessing and it's not correct @ManyToMany(targetEntity = Purchase.class, fetch = FetchType.EAGER) ...

84. null entries coming in list hibernate one to many mapping    forum.hibernate.org

Hi , when i using one-to-many mapping with list , i a getting the value with null initially and after that actual results for Example: i am getting list as 3,first value is null and remaining two are my result values for next record list is 5,first 3 values are null and remaining two are our actual results. thanks in advance ...

85. Annotations to maintain a list of Locale for client    forum.hibernate.org

Hello. I have two classes (Client and ClientLocale). I am trying to figure out how to maintain a list (or set) of java.util.Locale that the client supports (used for localization in the web app, using Wicket). The locales are stored in a set in the Client entity, as: private Set clientLocales = new HashSet(); with the relevant get and set methods ...

86. how to retrieve first object of a list poperty using query    forum.hibernate.org

Hi All, I have two tables " application " and " user ". So Application has @ManyToMany relation with User. below is the code for @ManyToMany. Application.java --------------------- protected List users= new ArrayList(0); @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @JoinTable( joinColumns=@JoinColumn(name="application_fk"), inverseJoinColumns=@JoinColumn(name="user_fk")) @ForeignKey(name="FK_USER_APPLICATION", inverseName="FK_APPLICATION_USER") @IndexColumn(name="applicant_order", base=0) public List getUsers() { return users; } public void setUsers(List users) { this.users= users; } i want ...

87. setFirstResult returning empty list before the end of data    forum.hibernate.org

Hello and I apologize if this has already been covered. I made numerous Google searches and also searched the forum here before posting. I am using the Criteria objects setFirstResult and setMaxResults methods to implement paging in my web application. I have about 167 records that I am paging through in the database. I display 15 records at a time. Everything ...

88. Cascade "all-delete-orphan" does not work for list    forum.hibernate.org

Thanks riks.java for the response. However, I still have the question. In my case, the association is one way (I use "inverse=false"). That is, only the parent references a list of children, but the children do not have a backward reference to the parent. I find this approach more programmer-friendly : I do not need to concern about the consistency between ...

89. Hibernate annontations and list    forum.hibernate.org

I have the following two classes. I want the order to contain a list with orderlines. My question is how I make a mapping such that I automatically can retrive the orderlines when I get the order object. And visa verca, if I build up a object with order and a list with orderlines, how do I make the mapping such ...

90. Query list error    forum.hibernate.org

Hi all, I have the following code: public List getAllPropositionAttributes() throws HibernateException { List< PropAtt> result = null; Query query = getSession().createQuery("from PropAtt propAttribute"); result = (List< PropAtt >) query.list(); } result object is a list of records, but all the record are the same. For example result[0] = 200;Color;Red (are internally to PropAtt object) result[0] = 200;Color;Red (are internally to ...

91. Unknown column 'elt' in 'field list'    forum.hibernate.org

Author Message ralph961 Post subject: Unknown column 'elt' in 'field list' Posted: Sun Jun 28, 2009 8:06 am Newbie Joined: Sun Jun 28, 2009 7:57 am Posts: 2 I have an object "History" than insures that an enclosed list in the valid order and add some functionality. I am trying to map this object as a component which contains ...

92. Change the criteria list method    forum.hibernate.org

so... resulttransformer wasn't what i was looking for. I can build objects with it, but i can not choose if a object must be inside or not in the list. I know that i should do that with hql or criteria, but sometimes the sql query is a little bit boring and, if the performance enables, i would like to filter ...

93. Problem using instead of when mapping a collect    forum.hibernate.org

94. filter list with Criteria    forum.hibernate.org

95. List Tables    forum.hibernate.org

97. On object related (through a list) to two different objects.    forum.hibernate.org

Hello everybody, I have a problem with an object related (through a list) to two different objects. Bellow is a model of the problem: @Entity @Table(name = "table1", schema = "public") public class Class1 implements java.io.Serializable { .... @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "parent") public List getObjectComponents() { return this.objectComponents; } public void setObjectComponents(List objectComponents) { this.objectComponents = ...

99. "SQLStateConverter" exception on Query.list()    forum.hibernate.org

Hi All, I am getting the below error on executing a list() method on Query object. org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) org.hibernate.loader.Loader.doList(Loader.java:2231) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) org.hibernate.loader.Loader.list(Loader.java:2120) org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:935) org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148) org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) The same code was working fine till last week. After getting this error, we restarted the server and it started working fine again. Any help is greatly appreciated. Thnx.

100. Difficulty in Listing for the code of the session that is ve    forum.hibernate.org

System.out.println ("HELLO PERSONAL"); I am beginning the studies with Hibernate and I am wondering how I do for logar with a supplier that consists a codEmpresa in his/her table as key FK, to the logar and to verify that the code is an altomaticamente he falls in the listing of suppliers, I am with doubt as I recover that and as ...