-->
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: Problem with composite-id and Criteria
PostPosted: Wed Jun 08, 2005 3:34 pm 
Newbie

Joined: Wed Jun 08, 2005 1:47 pm
Posts: 1
Hi people,
I have a problem with Hibernate when use Query by Example and the object have a composite-id. When i call the criteria.list() the list return all objects of table. The hibernate dont add composite-id in where clause.

Class:
public class ProdutoComposite implements Serializable{
private String idProduto;
private String idEmpresa;
private String descricao;
private double valorUnitario;

/*
Here i implements hashCode equals and acessors methods

*/

}




Hibernate version: 3.0.5

Mapping documents:
<hibernate-mapping>
<class name="com.csi.prototipo.produtocompositeid.ProdutoComposite" table="rodrigo_composite_id">
<composite-id>
<key-property name="idProduto" column="ID_PRODUTO"/>
<key-property name="idEmpresa" column="ID_EMPRESA"/>
</composite-id>
<property name="descricao" type="string" column="descricao"/>
<property name="valorUnitario" type="double" column="valor_unitario"/>
</class>
</hibernate-mapping>


Full stack trace of any exception that occurs:
None


Name and version of the database you are using: Oracle 9i and Driver ojdbc14.jar

The generated SQL (show_sql=true):
Hibernate: select this.ID_PRODUTO as ID_PRODUTO0_, this.ID_EMPRESA as ID_EMPRESA0_, this.descricao as descricao0_, this.valor_unitario as valor_un4_0_ from rodrigo_composite_id this where (1=1)

_________________
Rodrigo Oliveira


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 1:08 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 1:04 pm
Posts: 26
I got the same problem with composite id and Criteria...
I am looking for a solution too.
Anybody ?


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.