Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Query for custom entities


I´m having a custom entity, CustomClub, that derives from Club. I want to create a query that gets all CustomClubs that has a certain Category, what is the preffered way of doing that?

Hoping for a solution that doesn´t require writing SQL/HQL queries to the community database as in Joels blogpost.

Sep 22, 2009 16:44

Hey Niklas,

You can set up queries for your custom entities by adding NHibernate mappings and custom queries. I've been planning to write a blog post about that for quite some time but haven't gotten around to it :( You can use Reflector and take a look at the built in modules though.

Sep 23, 2009 10:18
Thanks! Got it partly to work. Looking forward to that blogpost :)
Sep 24, 2009 13:38

Just read this post again and realized that I solved the problem. The answer was to set the EntityTypeOverride attribute on my derived class. After that, just go ahead and use the ClubQuery or any class derived from that.



CustomClub : Club


Apr 09, 2010 11:25
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.