In the container the primary key is an int. In the many side, the foreign key is a String. Any way this will work with a mapping in Hibernate?
Hibernate version:
2
Mapping documents:
Code:
<!-- in this table the key is an int -->
<id name="pennId" column="PENN_ID" unsaved-value="0">
<generator class="assigned"/>
</id>
<set name="pcadminGaBlobsFastSet">
<key column="blob_person_id"/> <!-- here it is a string -->
<one-to-many class="PcadminGaBlob"/>
</set>
Code:
<class name="PcadminGaBlob" table="GA_BLOB_SIMPLE_V">
<id name="rowId" column="prod_ROWID" unsaved-value="UNSAVED_VALUE">
<generator class="assigned"/>
</id>
<!-- this is a string -->
<property name="pennId" column="BLOB_PERSON_ID" />
</class>
Full stack trace of any exception that occurs:ORA-01722: invalid number (meaning the view is expecting a string, and we are sending a number)
Name and version of the database you are using:Oracle 9i
The generated SQL (show_sql=true):Code:
select pcadmingab0_.prod_ROWID as prod_ROWID__, pcadmingab0_.blob_person_id as blob_per5___, pcadmingab0_.prod_ROWID as prod_ROWID0_, pcadmingab0_.BLOB_PERSON_ID as BLOB_PER2_0_, pcadmingab0_.IMAGE_VERSION as IMAGE_VE3_0_, pcadmingab0_.SEGMENT_NUM as SEGMENT_4_0_ from GA_BLOB_SIMPLE_V pcadmingab0_ where pcadmingab0_.blob_person_id=10021368
In a perfect world, I could change the type in the DB, but legacy data and I cant touch it, and simply making a view where the type changes doesnt work. I guess I could just query explicitly for it and not auto grab...
Thanks,
Chris