-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Fully-qualified list of objects from Criteria
PostPosted: Tue Jun 03, 2008 4:42 pm 
Newbie

Joined: Tue Jun 03, 2008 2:24 pm
Posts: 3
I'm using Hibernate 3.2.2 and trying to retrieve a fully-qualified list of objects from the criteria.list(). Objects are always returning unqualified.
This is required for my application in order to avoid another layer of transformation (hence performance). I wonder if there is any setting i miss in the class mapping file (hbm), or the hibernate configurations.

I'm also working with nHibernate and I noticed that the list of retrieved objects is fully-qualified.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 07, 2008 2:27 pm 
Newbie

Joined: Tue Jun 03, 2008 2:24 pm
Posts: 3
I'm wondering if I need to rephrase my question to get any reply from this forum.

Each object returns in the list from the Criteria is not fully-qualified (does not include the full package name). I wonder if this is hibernate configuration issue, CGLib issue, a feature, or a bug.

Any hint would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 10:39 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
The criteria query should be returning objects that are consistent in name and package of the type being queried.

What does your query look like? Maybe we can help out if we see it?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 23, 2008 2:18 am 
Newbie

Joined: Tue Jun 03, 2008 2:24 pm
Posts: 3
Thanks Cameron for the response.
Here is the Java code for the Criteria and the mapping file:

com.example.products.Products obj = new com.example.products.Products();
Session session = getHibernateTemplate().getSessionFactory().openSession();
Criteria criteria = session.createCriteria(obj.class, "row");
List result = criteria.list();

The mapping file:
<hibernate-mapping package="com.example.products">
<class name="Products" table="Products">
<id name="productID" unsaved-value="-1">
<column name="ProductID" not-null="true"/>
<generator class="native"/>
</id>
<property name="productName" column="ProductName" not-null="true"/>
<property name="unitPrice" column="UnitPrice" not-null="false"/>
</class>
</hibernate-mapping>

I'm getting a list of "Products", and I'm expecting a List of "com.example.products.Products".

Appreciate your help,
Rudy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.