hey thx for your answer. i'd like to rate it but i have problems find the button/link (whatever it is) to do this. :/ but i will figure out and as soon i know it i will do it.
by generic classes i mean:
Code:
class SomeClass<TypeOfAProperty> {
private TypeOfAProperty aProperty;
public TypeOfAProperty getProperty() {...};
public void setProperty(TypeOfAProperty aProperty) {...};
}
now i can do the following:
Code:
SomeClass<String> exampleA = new SomeClass<String>();
exampleA.setProperty("testtest");
SomeClass<Integer> exampleB = new SomeClass<Integer>();
exampleB.setProperty(new Integer(44));
the problem is the type that can change and how will hibernate know what kind of class to instantiate when it loads a generic class from the database. and i think its getting even worse if i want to use an EntityType instead of a ValueType like in this example. is there any elegant solution in hibernate or will i have to create non-generic classes with their own mapping files? maybe i can create a generic mapping and use this to instantiate non-generic mappings?