|
SRJRCFrames v0.1.296 |
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
ChildEntity<E extends Entity> | interface for all children types, that means for entities, that model a 1:n relation and which need to keep the id of the parent instance. |
Entity | Entity is the interface to bring persistence to business objects. |
EntityReference<A extends Entity,B extends Entity> | reference handle class to handle anonymous references. |
NamedChildEntity<A,B extends Entity> | is an NamedEntity and a ChildEntity . |
NamedEntity<E> | interface for all entities, that could be identified by their name. |
VdrEntity | interface to mark an Entity as being attached to the VDR |
WeightedEntityReference<A extends Entity,B extends Entity,T> | interface for anonymous references, that need to be sorted |
Class Summary | |
---|---|
ResourceNode | TreeNode implementation to build a tree from help pages. |
provides the basic classes and interfaces for anonymous persistence. This is the data-part of the anonymous Persistence layer.
find
or save
without having to care about used relations or the type of persistence
The last requirement leaded to a baseclass for all business classes, as they
are involved in user interactions (so they need to be a Model
), they may be sent across the network, so they need to be
serializable
and of cause, they should contain enuf information, that
a workflow from one storage over transmission between different VMs into a
quite different storage should work.
Entity
is the interface, that all business classes
should derive from and AbstractEntity
is
the base implementation to cutoff all the grunt work from business classes. I
decided to use the model from jgoodies binding, so the jgoodies forms
library could be used to ease the creation of nifty user interfaces.
Every business class must provide a public default constructor (like any bean should do). This is needed for the extended reflection.
See de.schwarzrot.data.access
for the worker part of Persistence
layer.
Most references are solved by contract from the persistence layer:
A direct relationship is given, if one Entity
has a property of
(sub)type Entity
.
Child - relationship (1:n in database terms)
named children - the parent has a property
Map<Object, NamedChildEntity>
, where the key of the map is the result
of namedChild.getName()
. NamedChildEntity
is parameterizable,
so the return type of getName()
could be specified with generics.
The Map
returned by getMappings()
must contain an entry like:
myMappings.put("children", YourChildEntity.class.getName());That's all, what needs to be done by the application developer to implement a named child relation
unnamed children. - the parent has a property
List<ChildEntity>
and the Map
returned by
getMappings()
must contain an entry like:
myMappings.put("children", YourChildEntity.class.getName());
Map
, with the grouping value as
key. Named children will be grouped by
Map<GroupClass, Map<NameClass, NamedChildrenClass>>
, unnamed children
will be grouped by Map<GroupClass, List<ChildClass>>
. To enable the
persistence layer to support grouped children, the parent's Map
returned by getMappings()
needs an entry like:
myMappings.put("children", "groupingPropertyName|" + GroupedChildrenClass.class.getName());See
de.schwarzrot.data.test.domain
for basic implementations.anonymous - relationship (n:m in database terms)
EntityReference
is the base class for the
anonymous relationship and WeightedEntityReference
the base class,
for sorted relations. Implementation of both reference types must also be an
Entity
.
Implementation of business objects is quite the same, as with named/unnamed
children. The master- Entity
has a property
Map<Object, EntityReference>
to hold the related instances, where
reference.getWeight()
is the key for the Map
. Unsorted
references can be hold in a property List<EntityReference>
.
persistence introduced the desire in statistics, so some basic properties are
required for all entities. The application-developer may use them, but need
not care about them. The EntityHandler
will do that.
Other informational Entity
-methods needed to deal with persistence:
EntityManager
to respect this call. Don't rely upon all
EntityManager
s doing so.isUserType()
returns false
may specify
properties, that a user is allowed to change and savetrue
The persistence layer supports two types of virtualization:
closed virtualization. The closed virtualization means, all
possible classes for given table are known at compile time, so this could be
realized with an Enum
-Class
-mapping (
getVariantTypeMap()
). Sample for closed virtualization is
de.schwarzrot.rec.domain.Stream
.
open virtualization. The open virtualization is used, when the
range of classes are not known at compile time, or when a table is intended
to be extended at runtime. That cases are realized by storing the fully
qualified classname in the table. A non-trivial sample for open
virtualization is de.schwarzrot.dvd.theme.domain.ThemeBase
.
|
SRJRCFrames v0.1.296 |
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |