Hi.
How can I create a
CompositeUserType containing a collection in hibernate 4.3?
I tried to create the
CompositeUserType as follows:
Code:
public class MyType implements CompositeUserType {
@Override
public Type[] getPropertyTypes() {
return new Type[]{StringType.INSTANCE /* , SetType */};
}
}
For a class like
Code:
public class My {
private String name;
private Set<Integer> numbers;
// ...
}
But how do I get an instance of
SetType to accomplish the desired result?
Looking at the javadoc of CompositeUserType#deepCopy():
Quote:
Return a deep copy of the persistent state, stopping at entities and at collections.
I think, that it should be possible to embed collections into
CompositeUserTypes.
Regards
Christian