-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Howto map not standard types
PostPosted: Thu Jun 15, 2006 8:20 am 
Newbie

Joined: Thu Jun 15, 2006 8:08 am
Posts: 1
Hi,
I am completely new to Hibernate and I fear that the question has been asked quite a few time, but I could not find any answer.

I have an existing object model, which should not be changed. In this data model a lot of artificial keys are used like for the following class

class User {
private OID oid;
private String name;
....
....
....
}

The corresponding database table is:

table USER (
oid NUMBER(10,0)
name varchar(50)
)

How can I map this! The first idea,

<hibernate-mapping package="...">
<class
name="User"
table="USER">

<id
name="oID"
column="OID"
type="....OIDImpl">
<generator class="assigned">
</generator>
</id>
</hibernate-mapping>

causes the understandble error

ORA-00932: tipos de dato inconsistentes: se esperaba NUMBER se ha obtenido BINARY
(Inconsistent data types: NUMBER expected, BINARY received)

Any help would be apreciated

PS: I use Hibernate 3


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 9:59 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
implement org.hibernate.usertype.UserType for the OID class

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.