-->
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.  [ 4 posts ] 
Author Message
 Post subject: Custom UserType example
PostPosted: Tue Aug 09, 2005 6:34 am 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
Where I cat find some example of custom user type definition?

I want to define a new type for mapping arbitrary lenght array of
float in "|" separated CLOB. Example:

1.32|3.22|2.12|....

Is this a good idea?
Other solutions?

Thanks.

Gianni Antini
Florence - ITALY


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 7:05 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
The other solution is to create an Entity that encapsulates your float and create a one-to-many relationship.

I you want usertype samples you can search in the test folder or you can grab caveatemptor from the hibernate site (you can find more complex examples)

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 7:10 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Use the search function of the Hibernate site to find some examples:
http://www.hibernate.org/272.html
http://www.hibernate.org/265.html
http://www.hibernate.org/169.html

I don't know you exact use case, but I can also image to use a simple one-to-many relationship.

Code:
        1.32
      /
array - 3.22
      \
        2.12
        .
        .
        .


Best regards
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 7:21 am 
Beginner
Beginner

Joined: Fri Aug 20, 2004 3:45 pm
Posts: 22
Location: Florence - ITALY
I think that the use of one-to-many relationship is not
suitable for my context.

I have a matrix of float for every row of a table. The typical
dimension of the matrix is 90*14, but sometimes its 90*1.

So I suppose that the use of an internal codification of a CLOB
field is better for me.

Example (for more than one row):

1.21|2.11|3.21;1.33|2.12|2.43

this is 2*3 matrix.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.