-->
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: Newbie Help..
PostPosted: Wed Jun 15, 2011 5:35 am 
Newbie

Joined: Wed Jun 15, 2011 5:21 am
Posts: 1
Hi all, i am a newby with hibernate so i hope you don't hate me if the following is a stupid question :-)

This is my problem:

I want to make a query whose result il a list of a models that is extracted giving an id such a foreign key of another model ->

table cliente
fields (idCliente , the pk) nome(varchar)

table Commessa
fields (idCommessa, the pk) nome(varchar) fkCliente (references to cliente.idCliente)

I know the names are in camelCase but this is only a test so i didn't mind that.
When i wrote models i used annotation instead of xml mapping files and if i try to run it without a query that takes care of foreign key it gous weel so i think the annotation are right but to be more sure i post the member of the model Commessa thet refers to Cliente:

@ManyToOne (cascade = CascadeType.ALL)
@JoinColumn(name="fkCliente")
private Cliente fkCliente;

The db was created by hibernate to the proper property in mode "update"

Tha point is that i want to estract a list of "Commessa" by a "Cliente.idCliente"

Pls don't tell me to view the documentation because i've seen it a lot before asking it so i'll be vary pleasure if someone tells me here how i can do that.

Thanks a lot for your time :-)


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.