Hi,
I try to explain (my English isn't so good).
Do you know DynaBeans of jakarta.commons? With Dynabeans you can create beans at run-time writing and code like the follows rows:
DynaProperty[] props = new DynaProperty[]{ new DynaProperty("address", java.util.Map.class), new DynaProperty("lastName", String.class) }; BasicDynaClass dynaClass = new BasicDynaClass("employee", null, props);
DynaBean employee = dynaClass.newInstance(); employee.set("address", new HashMap()); employee.set("lastName", "Flintstone");
I think that can be possible to create a persistence layer that, perhaps in other manners, permit you to create persistence beans at run time like Dynabeans but persisted.
Obviously not all will be permitted for example the type of bean properties could be only String, Number, Boolean, File and Collection.
There are more limits to stand ..... (nested collections etc..)
Is possible to do this with Hibernate? Or I have to Implement myself the layer and DB mapping?
Thanks for your attention
bye
|