-->
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.  [ 1 post ] 
Author Message
 Post subject: CreateCriteria for a part of a component
PostPosted: Tue Apr 12, 2005 7:24 pm 
Newbie

Joined: Tue Apr 12, 2005 7:12 pm
Posts: 1
I created a component phoneNumber with a countrycode, an areacode and a localphoneNumber. I store this as a string :

/**
* @return Returns the phoneNumber.
* @hibernate.property
* length = "20"
* unique = "false"
* update = "false"
*/
public String getPhoneNumber() {
return countryCode + "_" + areaCode + "_" + localPhoneNumber;
}

I use this in an other class like this :

/**
* @return Returns the phone1.
* @hibernate.component
* prefix = "phone1_"
*/
public PhoneNumber getPhone1() {
return phone1;
}

It workes well, but can I create a criteria where I search only the countrycode ? How do I do this ?

Hibernate 2:

MySQL:


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

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.