Problem using component tag in hql (Hibernate)

N

Nettar

Hi,

I have a problem related to Hibernate.

I have the following Data Bean:

class MyDataBean
{
private String id;

private MyComponent myComponent;

... getter and setter methods ...
}

class MyComponent
{
private String myValue;

... getter and setter methods ...
}

Mapping:

<class name="MyDataBean" table="MY_TABLE">
<id ...>
<component name="myComponent" class="MyComponent">
<property name="myValue" column="MY_VALUE">
</component>
</class>

Now, I need to execute the following hql:

from MyDataBean where myValue = :value

My database has the table MY_TABLE which has a column named "MY_VALUE"
of type varchar2.

But, Hibernate is taking the column name for myValue as MYVALUE even
though I have specified the column name as MY_VALUE in the mapping.
And it is throwing an exception saying that: invalid identifier name
"MYVALUE".

To summerize:
----------------------
HQL doesn't take the column name specified inside a <component> tag. It

assumes the default column name derived from the bean's property name.

Can someone help me on this?
Is it a bug is Hibernate? Or am I doing a mistake here?

Thanks in advance,
Jayarama Nettar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top