Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1.0
-
Fix Version/s: 1.1.0
-
Component/s: trails-hibernate
-
Labels:None
-
Environment:All
-
Number of attachments :
Description
SINGLETON Annotation required to properly manage these at entity level.
Why? Management of these KINDS of singletons gets too clouded when you factor in the following:
- having to maintain seeded entities in xml
- having to articulate other dependent annotations attributes to alter schema logic
- having to worry about whether the seeded entity will instantiate based on what other
foreign keys may prevent it from being instantiated - other schematic dependencies based on foreign key
It is better to nail one pojo down as singleton and then it is easier to operate is as an ASO in tapestry or the entity could be operated implicitly as a back end kind of ASO whereby tapestry/hivemind would no longer be needed and the app could just refer to the getInstance(...).
It seems I am leading to Singleton PropertyEditor which might turn out to be a sub-spinnoff from HARD OneToOne property editor but only on the back side of it's logic. It seems like it would behave just like the HARD OneToOne but the back end would mandate only one entity.
So upon completion of the annotation, we could decorate based on this condition and/or add an attribute to the existing OneToOne that would aritculate OneToOne.HARD or OneToOne.SOFT
I still fail to see any benefit in this annotation. You certainly don't have maintain seeded entities in xml - it's simply one way to seed the database. I have no idea what "having to articulate other dependent annotations attributes to alter schema logic" means. ASOs are not connected to persistent entities. If you just want a single entity, make it's id property always return a static value. If you want a true singleton, implement a static class/method that'll always return a single instance, with values populated either from database using getInstance, XML or in Spring configuration.