Logo UGIdotNET

Discussione 'Bag Magging con where clause'

# Pubblicato il 04 mag 2009 10.15 - Rispondi
Simone Feriti
Bag Magging con where clause
Ciao a tutti,
stavo cercando delle soluzioni per caricare una bag di un oggetto in cui avere una clausola where un po' complessa che non si limiti a controllare campi/property della classe ma valori di classe che sono in relazione im many-to-one con la stessa, ho provato a cercare degli esempi ma non trovo nulla, avete suggerimenti
Grazie
Simone
# Pubblicato il 04 mag 2009 17.12 - Rispondi
Gianluca Carucci
Re: Bag Magging con where clause
A cosa ti riferisci? Entity Framework? NHibernate?
# Pubblicato il 05 mag 2009 8.32 - Rispondi
Simone Feriti
Re: Bag Magging con where clause
Dimenticavo parlavo di nhibernate.
Grazie
SImone
# Pubblicato il 05 mag 2009 9.43 - Rispondi
Gianluca Carucci
Re: Bag Magging con where clause
Ciao Simone,
intendi qualcosa di questo tipo?:
" The SQL functions any, some, all, exists, in are supported when passed the element or index set of a collection (elements and indices functions) or the result of a subquery (see below).

select mother from Eg.Cat as mother, Eg.Cat as kit
where kit in elements(mother.Kittens)

select p from Eg.NameList list, Eg.Person p
where p.Name = some elements(list.Names)

from Eg.Cat cat where exists elements(cat.Kittens)

from Eg.Player p where 3 > all elements(p.Scores)

from Eg.Show show where 'fizard' in indices(show.Acts)"

Trovi il resto qui:
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#queryhql-where
oppure ottieni risultati analoghi anche le subquery:
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#queryhql-subqueries
# Pubblicato il 06 mag 2009 9.03 - Rispondi
Simone Feriti
Re: Bag Magging con where clause
Il mio dubbio è se questo funziona anche quando vado a specificare una clausola where nel file di mapping su una bag, come per esempio questa
bag name="Articoli" lazy="true" cascade="save-update" where ="DeletedDate IS NULL"
ma con where più articolate
Grazie
Simone
# Pubblicato il 07 mag 2009 8.47 - Rispondi
Gianluca Carucci
Re: Bag Magging con where clause
Ciao Simone,
immagino tu abbia fatto delle prove: quali? Cosa funziona (immagino l'esempio che hai mostrato) e cosa no? Quali -eventuali - errori ti sono stati restituiti?
Scusa per l'"interrogatorio" ma, per aiutarti, mi serve per capire che problemi hai avuto:)
Grazie
Gianluca

© 2001 User Group Italiano UGIdotNET. Tutti i diritti riservati. Note legali. - Partita IVA 01927050185