-->
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: problems with criteria queries
PostPosted: Fri Aug 08, 2008 11:33 am 
Newbie

Joined: Tue Aug 05, 2008 3:50 pm
Posts: 2
Hi everyone,
my problem is with a criteria queries.

This is my case:
DetachedCriteria dc =
DetachedCriteria.forClass(TransferenciaLote.class);
dc
.createCriteria("transferenciaLoteDetalle") //is a collection of Transferencia
.createAlias("cuentaDestino", "cuentaDestino")
.add(Restrictions.like("cuentaDestino.denominacion", "GONZALEZ CARLOS",MatchMode.ANYWHERE));

That works fine but, I would need to put it (my DetachedCriteria object) inside other criteria object, because I have other queries to execute too. I mind, I need to retrieve all elements inside collection, and then other cases, but all together over one criteria.

it would be something like this:

Criteria crit = session.createCriteria(TransferenciaLote.class);
crit.add(Restrictions.like("observaciones", "otros",MatchMode.ANYWHERE)); //other
crit.add(????("???", dc)); //here would be DetachedCriteria object

My classes:

TransferenciaLote.java
public class TransferenciaLote extends TFLObject implements IPersistant, IViewable {
private List transferenciaLoteDetalle;
private String observaciones;


Transferencia.java
public abstract class Transferencia implements IPersistant, IViewable, Serializable {

private CuentaBase cuentaDestino;
private TransferenciaLote transferenciaLote;


can everyone help me ¿?

Best regards

Julián


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.