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: changing the database schema
PostPosted: Mon Jun 30, 2008 9:24 am 
Newbie

Joined: Mon Jun 30, 2008 8:27 am
Posts: 1
Location: Warsaw, Poland
Hi

Is there any way to transform the database schema in memory before hibernate will do the actual mapping??

I have a table in a legacy db that looks like this:

Code:
BLACK_REQUEST_PARAM
REQ_ID   |    NAME   |   INOUT   |   VALUE   
1      |   param1    |   I      |   value1
1      |   param2   |   I      |   value2      
1      |   param3   |   O      |   value3
2      |   param1   |   I      |   value4
2      |   param2   |   I      |   value5
2      |   param3   |   O      |   value6   
(...)


However, I want it to be mapped into this:

Code:
public class BlackRequestParamIn {
   @Id
   private Long reqId;
   private String param1;   
   private String param2;      
   (...)   //other parameters
   
   //non-arg constructor
   
   //getters & setters
}
,

and respective class for out parameters -- just as if DDL was totally different

I know that I can "map" hibernate VO's properties into my own class'es properties in DAO but I was wondering if hibernate is capable of doing something similar before the mapping


thx in advance
pete

PS: the database schema cannot be modified :/


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.