-->
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.  [ 1 post ] 
Author Message
 Post subject: how to use the class implemented the interface of UserType
PostPosted: Tue Jan 04, 2005 3:54 am 
Newbie

Joined: Thu Dec 16, 2004 2:58 am
Posts: 5
Hibernate version:2.1.2

Mapping documents:
<property
column="COLUMN_NAME"
name="alias"
not-null="false"
type="MyCustomedType"
/>


Name and version of the database you are using: oracle 9.2.0.1

I create a class named MyCustomedType which implemented the interface of UserType, and the relative mapping part is shown above.
I try to use MyCustomedType as follow:
Code:
StringClobType oct = new StringClobType();
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@server_name:1521:SID", username, password);
oct.nullSafeSet(conn.prepareStatement("select * from table_name"), value, index);

Though it works, I don't think that follows the implementation of the interface, since it goes back to SQL.
Plz tell me the right way, thanks lot and lot!
And, sorry for my bad English!


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

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.