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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top