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.
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.