I have a Hibernate class which is essentially a wrapper around multiple collections.
So the class (massively simplified / pseudo) is something like:
@Entity
public class MyClass {
@OneToMany
Map1
@OneToMany
Map2
@OneToMany
Map3
AddToMap1 ();
AddToMap2 ();
AddToMap3 ();
RemoveFromMap1 ();
RemoveFromMap2 ();
RemoveFromMap3 ();
DoWhateverWithMap1 ();
DoWhateverWithMap2 ();
DoWhateverWithMap3 ();
}
etc .. Each of these cards has several methods associated with it (add / remove / interrogate / etc).
As you can imagine, by the time I added the 10th collection or so, the class was getting a bit ridiculous in size.
What I would like to do is something like:
@Entity
public class MyClass {
ClassWrappingMap1;
ClassWrappingMap2;
ClassWrappingMap3;
}
, :
public class ClassWrappingMap1 {
@OneToMany
Map
AddToMap();
RemoveFromMap();
DoWhateverWithMap();
}
, , , @Embedded , , , (Hibernate wrapperClass).
- - - ? ?
,
Ned