Wow this is a headache! Simple really, what I want to do is to be able to execute HQL queries in Eclipse. Seems like an easy task, yes?
MiddlegenTask executes to create a lovely set of mapping files with composite keys resolved with entries such as...
Code:
<composite-id name="comp_id" class="uk.co.billabong.pojo.CurrencyRatePK">
<meta attribute="field-description" inherit="false">
@hibernate.id
generator-class="assigned"
</meta>
<key-property
name="sourceCode"
column="source_code"
type="java.lang.String"
length="4"
>
<meta attribute="field-description">
@hibernate.property
column="source_code"
length="4"
</meta>
</key-property>
<key-property
name="destinationCode"
column="destination_code"
type="java.lang.String"
length="4"
>
<meta attribute="field-description">
@hibernate.property
column="destination_code"
length="4"
</meta>
</key-property>
</composite-id>
Running hbm2java wonderfully translates these mapping files into pojos whiole creating composite key classes, as required.
I then setup the hibernate.cfg.xml document ok but when I attempt to create a hibernate configuration I get a...
Quote:
Sessionfactory error: component class not found: uk.co.billabong.pojo.CurrencyRatePK
caused by a
Quote:
ClassNotFoundException: uk.co.billabong.pojo.CurrencyRatePK
I am assuming HC uses the Eclipse classpath where it should quite happily locate said classes! I have also included the pojo location in the HC setup but to no avail. With this error I am unable to perform any queries and my head hurts with all this bangin on wall!
Why is HC unable to locate this composite key class???? Is it hiding? Has it nipped out for lunch???? Seriously though, I'm baffled. I have scoured the internet for help but it seems there is no-one else on this planet with the same problem (well there might be but they're probably hiding as well!!!).