|
From: Alok P. <ap...@dm...> - 2002-12-17 17:33:48
|
Hi,
We use GUID (mapped to an Oracle RAW(16)) as out object id/primary keys. The
skeletal GUID class looks like this
class GUID {
public byte[] getBytes() {...}
public void setBytes(byte[] bits) {...}
}
We would like to bind these GUIDs as byte[] (PreparedStatement.setBytes) and
I am trying to figure out what should
the class mapping look like For example I have it currently defined as :
<class name="test.Person" table="PERSON" >
<id name="bits" type="binary" column="GUID">
</id>
<property name="name" type="string"/>
</class>
and I get the following error when I try to insert a Person object.
17-Dec-2002 11:22:48.679 [ERROR] DatastoreImpl: Could not compile the
mapping document
cirrus.hibernate.MappingException: illegal use of an array as an identifier
(arrays don't reimplement equals)
at cirrus.hibernate.map.RootClass.<init>(RootClass.java:157)
at cirrus.hibernate.map.Root.<init>(Root.java:145)
at cirrus.hibernate.impl.DatastoreImpl.store(DatastoreImpl.java:103)
at
cirrus.hibernate.impl.DatastoreImpl.storeFile(DatastoreImpl.java:68)
How do I specify the type of the GUID?
Thanks
-Alok
|