Hi All,
Considering Hibernate 3,
I would like to map a legacy class to a new Db table. (I have to use a legacy model .jar and have to store these objects in a new db) But my legacy object does not declare a default no arg constructor and i am not able to change the contract because it is part of an API model. (shared by legacy apps). I neither do not want to write a new class for this and do not want to transcode from one to other.
Let's say I have a class with 3 attributes and only a default constructor(arg0,arg1,arg2), and each arg has to be mapped with a column in db (table with 3 col). I have to store and retrieve objects.
Would it be possible without having to declare a default no arg constructor ? Using an interceptor ? would it be possible to access 3 columns to call constructor with args ?
NB : sorry, i forgot to say, no setter on these 3 attributes to ensure developpers use the 3 args constructor.
Thanks by advance.