The scenario is:
I have 3 tables STORE, FISCAL_PERIOD, and STORE_DETAIL. The STORE_DETAIL has two columns store_id (pk for STORE table) and fiscal_period_id (pk for FISCAL_PERIOD table). These two columns form a unique constraint in STORE_DETAIL table
I have a class Store that has getStoreDetails() that returns a set. However, I'd like to get storeDeatils for a specific fiscal_period_id. I was hoping that using Artifact Generation, the unique constraint would automatically be created providing me a method to getStoreDetailsByFiscalPeriod(FiscalPeriod fp). It is a mjor performance hit to first getStoreDetails and then using createFilter (that actually creates a copy) to get the list by FiscalPeriod.
Is that true, if not, am I missing something, do I have to write custom code in the generated POJOs to provide this, if so, how would that change the *.hbm.xml
Thanks in advance!
Atul
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: