-->
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: UserType accesses property Configuration information?
PostPosted: Thu Jul 28, 2005 6:14 pm 
Newbie

Joined: Tue Dec 16, 2003 8:34 am
Posts: 15
Folks,

My database uses fixed-length CHAR fields, which I map to variable length String objects. So I would like to employ a custom UserType to trim and pad the DB values as they come and go. However, my UserType implementor needs to know the length of the corresponding column in order to perform the pad. I've tried something like this inside nullSafeSet:


PreparedStatement statement_, int index_

columnWidth = statement_.getMetaData().getColumnDisplaySize(index_)

but my jdbc driver doesn't seem to support this call before ins upd or del:

[junit] java.sql.SQLException: [NEON][SCOD32TR.DLL]No columns available to describe
[junit] at com.neon.jdbc.SQLError.Check(SQLError.java:410)
[junit] at com.neon.jdbc.ProxyLocal.SQLColAttributes(ProxyLocal.java:1311)


Is there some way for a UserType to find which entity.property it is mapping for? It seems like it would be natural for this guy to either be constructed with that information, or to have it passed into nullSafeSet/get, or at least for some simple technique to retrieve it. I could use ParameterizedType, but then I'm essentially duplicating this information.

thanks,

joe


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.