I wonder that if I can handle the below scenario via Hibernate,
if yes that would be perfect.
In standard class mapping, we set the table where that class instances will be saved to. But I have some strange need,
I dont want to give a table name in the beginning of the class mapping,
in runtime according to user selection, the table that the instances will be changed, a small example:
Class Cars {
Long id;
String type;
String model;
....
}
In gui, user create a new car and set its type say; car.setType("sport");
and then called save, what I want, is saving this data to the table "@type@Car", may exist or not (hibernate creates non-existing tables)
in that example, the generated table will be "sportCAR" and that data will be saved to that table. Since I do not know all car types, I cant map them by table per concrete class mapping strategy in the initialization of hibernate and the configuration files.
Can I do such implementaion via hibernate?
_________________ -developer
|