Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Retrieving a list of objects using Criteria
PostPosted: Fri Nov 17, 2017 1:27 am 
Newbie

Joined: Fri Nov 17, 2017 1:25 am
Posts: 1
Im having an issue retrieving a list of objects using Criteria.

My code:
Code:
session = HibernateFactory.getSession();
Criteria criteria = session.createCriteria(Client.class);
List clients= criteria.list();


The last line I get:

Code:
[ERROR] 2017-11-17 00:06:36.474 [main] SetterMethodImpl - HHH000123: IllegalArgumentException in class: com.itrack.model.domain.Name, setter method of property: firstName
[ERROR] 2017-11-17 00:06:36.474 [main] SetterMethodImpl - HHH000091: Expected type: java.lang.String, actual value: com.itrack.model.domain.Donor


Sounds like its having some issue with the setter method. Sounds like its trying to set firstName with a Donor.
I'm lost.

Thanks


Top
 Profile  
 
 Post subject: Re: Retrieving a list of objects using Criteria
PostPosted: Fri Nov 17, 2017 2:45 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1582
Location: Romania
You forgot to add your mappings so we have an idea of what you are doing.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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.