-->
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 map User Data Type (Composite Type) with Hibernate
PostPosted: Wed Mar 14, 2012 11:45 am 
Newbie

Joined: Wed Mar 14, 2012 11:31 am
Posts: 2
Hi all, I am quite new to Hibernate world.
I have modeled by means of ER CASE (TOAD) my database and I have defined several User Data Type (Composite Type). For example assume I have a type Contact declared as follow in PostgreSQL

CREATE TYPE Contact AS
( "email" Varchar,
"phone" Varchar,
"mobile" Varchar,
"other" Varchar );

Now assume i use it on Users Entity like in the following SQL code

CREATE TABLE Users(
idUser Serial NOT NULL,
login Character varying(20) NOT NULL,
password Character varying(20) NOT NULL,
name Character varying(30),
surname Character varying(50),
contact Contact
)

-- Add keys for table Users

ALTER TABLE Users ADD CONSTRAINT pkIdUser PRIMARY KEY (idUser)
;

I have configured and used Hibernate Tools to do a reverse engineering of ER model, but I have problem on the definition of the Contact user type because it is mapped as Serializable and not as a custom type, What I am trying to have is to define a Contact Hibernate UserType and change according the reverse.xml file of the Hibernate Tools.....
Have you some link on a simple example on how to achieve this.
I am using Hibernate 3.5.4

Regards and thanks in advance for your support.


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.