Java Reference
In-Depth Information
/**
* Recursively map each color model package to Java package,
* mapping each Archetype to its respective EJB type.
*/
mapping
oocore::Package::toPackage() : java::JavaPackage {
name :=
self
.name;
eClassifiers +=
self
.contents[MomentInterval].
map
toEntity();
eClassifiers +=
self
.contents[MIDetail].
map
toEntity();
eClassifiers +=
self
.contents[Role].
map
toStateful();
eClassifiers +=
self
.contents[Party].
map
toEntity();
eClassifiers +=
self
.contents[Place].
map
toEntity();
eClassifiers +=
self
.contents[Thing].
map
toEntity();
eClassifiers +=
self
.contents[Description].
map
toEntity();
eSubpackages +=
self
.contents[Package].
map
toPackage();
}
/**
* A mapping from an Archetype to a Java class that
* is interited by each of the EJB mapping classes.
*/
mapping
dnc::Archetype::toClass() : java::JavaClass {
name :=
self
.name;
fields +=
self
.features[Attribute].
map
toField(
result
);
methods +=
self
.features[Operation].
map
toMethod();
}
/**
* A mapping to add obligatory Serializable implements clause
* to each EJB class.
*/
mapping
dnc::Archetype::toSerializableClass() : java::JavaClass {
implementsInterfaces += 'java.io.Serializable'.
map
toClass();
}
/**
* Map an Archetype to a @Stateful session bean, inheriting basic
* class and Serializable features.
*/
mapping
dnc::Archetype::toStateful() : java::JavaClass
inherits
dnc::Archetype::toClass
merges
dnc::Archetype::toSerializableClass {
eAnnotations += toAnnotation('description',
self
.description,
null
);
eAnnotations += toAnnotation('annotation', '@Stateful',
null
);
classImport += 'javax.ejb.Stateful'.
map
toClass();
}
/**
* Map an Archetype to an @Entity bean, inheriting basic
* class and Serializable features.
*/
mapping
dnc::Archetype::toEntity() : java::JavaClass
inherits
dnc::Archetype::toClass
merges
dnc::Archetype::toSerializableClass {
Search WWH ::
Custom Search