-->
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: Hi With regards(Problem In Mapping) :-Urgent
PostPosted: Thu Apr 19, 2007 5:07 am 
Beginner
Beginner

Joined: Thu Apr 12, 2007 12:04 pm
Posts: 25
Location: Chennai
Hi All,

Greetings!

Could anybody tell that how to make mapping file for follwing problem:--


There Are two Classes:--

1.UserDetailsBean
Properties:- Id(int),username(string)


2.NewLoginForm
Properties :- mdn(string),status(string)

Now all the four fileds available in one table named as "Login".

Table Login:

id number
username varchar(20)
mdn varchar(20)
status varchar(20)


Now i want to execute the query as
sql query==>:-select status from login where username='x1' and mdn='x2';

hibernate query:==>List crit1=session.createCriteria(NewLoginForm.class).setProjection(Projections.property("status")
.add(Restrictions.eq("mdn",mdn))
.add(Restrictions.eq("username",username)).list();


could anybody plz tell me mapping for above problem as sooooon as possible.

Thanks In Advanced.

With regards

Saurav Jain

_________________
I Really want to share my knowledge and learn from you all people specaily about Hibernate.. Thanks Lot


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 10:22 am 
Regular
Regular

Joined: Fri May 12, 2006 4:05 am
Posts: 106
Some questions in return:
- Is NewLoginForm an entity-class? Then what is it unique id-attribute (because every entity needs one)?
- Or is NewLoginForm a component-class without an object-id, then it should be contained inside another entity-class...


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.