-->
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.  [ 2 posts ] 
Author Message
 Post subject: Load Contact object by email
PostPosted: Wed Sep 08, 2010 11:32 pm 
Beginner
Beginner

Joined: Sat Oct 03, 2009 1:51 pm
Posts: 26
hello! My Criteria does not return the id of the object, I need to load the object by email I have this:
Code:
public Contato load(Contato contato) {      
      
      Criteria crit = session.createCriteria(Contato.class)
      .add(Restrictions.ilike("email", contato.getEmail(), MatchMode.EXACT));
      return (Contato) crit.uniqueResult();
      //return (Contato) session.load(Contato.class, contato.getEmail());   
   }

This is the print:

Image

Is returning the idContato is null. =/
I tried using the load method and Criteria unsuccessfully.

Can anyone help?
Thank You!


Top
 Profile  
 
 Post subject: Re: Load Contact object by email
PostPosted: Fri Sep 10, 2010 12:04 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Check whether the property is correctly mapped to the column!

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.