QueryOver And EntityName

85 views
Skip to first unread message

Jorge Ramos Eguinoa

unread,
Feb 24, 2011, 2:55:02 PM2/24/11
to nhusers
Hi, I would like to know if there is any way to use QueryOver with
"entity-name".
I have one class mapped to two database views using the "entity-name"
attribute in mapping file.
Currently I'm using CreateCriteria(string entityName) in order to
query the database and it's working fine but I would like to replace
this with QueryOver. Is there any way to do that?
Thanks in advance.

Jorge Ramos Eguinoa

Richard Brown (gmail)

unread,
Feb 26, 2011, 5:33:33 PM2/26/11
to nhusers
QueryOver doesn't provide any feature over ICriteria other than static
type-safety ... and if you're determining your class at runtime, I don't
think QueryOver will help?

Jorge Ramos Eguinoa

--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to
nhusers+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.

Jorge Ramos Eguinoa

unread,
Feb 28, 2011, 10:02:02 AM2/28/11
to nhusers
I get your point Richard and you are right.
I've asked because I have 1 single class mapped to 3 database views
wich returns the same columns.
In this scenario I could use QueryOver because the only thing that I
need is that NH knows wich view has to query as they have the same
columns.
But this is a particular case where the only thing that I'm
determining at runtime is wich view does NH has to query.
Thanks!



On 26 feb, 19:33, "Richard Brown \(gmail\)" <fluke...@googlemail.com>
wrote:
> For more options, visit this group athttp://groups.google.com/group/nhusers?hl=en.- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Richard Brown (gmail)

unread,
Feb 28, 2011, 11:56:11 AM2/28/11
to nhusers
Don't know if that's the same kind of thing that was asked about here:
http://stackoverflow.com/questions/4829303/nhibernate-queryover-using-base-classes/4874753#4874753

But there are statically typed overloads that can be used in the ICriteria
API too if that helps?

Jorge Ramos Eguinoa

unread,
Feb 28, 2011, 12:07:21 PM2/28/11
to nhusers
That should do the trick.
Thanks for your help Richard.

On 28 feb, 13:56, "Richard Brown \(gmail\)" <fluke...@googlemail.com>
wrote:
> Don't know if that's the same kind of thing that was asked about here:http://stackoverflow.com/questions/4829303/nhibernate-queryover-using...
> > athttp://groups.google.com/group/nhusers?hl=en.-Ocultar texto de la
Reply all
Reply to author
Forward
0 new messages