-->
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.  [ 3 posts ] 
Author Message
 Post subject: Need help with Regular of MySQL
PostPosted: Tue Dec 05, 2006 1:40 am 
Newbie

Joined: Tue Dec 05, 2006 12:42 am
Posts: 3
Location: Cambodia
public List<Email> findByEmail(String emailPattern) {
StringBuffer hql = new StringBuffer();
hql.append("select obj from Email obj.emailForm REGEXP :email");
Query query = this.session.createQuery(hql.toString());
query.setString("email", emailPattern);
return (List<Email>) query.list();
}

_________________
_
/.: :.\ \ \
:{[ @ ]}>>==>======||
\:._.:/ / /


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 5:31 am 
Beginner
Beginner

Joined: Tue Nov 21, 2006 5:18 am
Posts: 31
Location: Bangalore, India
What's your problem, write in detail is it REGEXP, or else,

you can change the query like these,

select obj from Email obj.emailForm = :email

_________________
persist_coder
--credit please if it helps you


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 08, 2006 6:14 am 
Newbie

Joined: Tue Dec 05, 2006 12:42 am
Posts: 3
Location: Cambodia
you know i want to use in the follow Native SQL

select * from tblUser where name REGEXP '^A{1,3}$';

like this, but i don't know how it was equal to HQL ?

_________________
_
/.: :.\ \ \
:{[ @ ]}>>==>======||
\:._.:/ / /


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