All Downloads are FREE. Search and download functionalities are using the official Maven repository.

entity.EntityChecks.chk Maven / Gradle / Ivy

There is a newer version: 1.24.1
Show newest version
import uml;
import JMM;

extension java::Naming;
extension entity::ModelProperties; 
extension java::GeneratorCommons;


// Checks for stereotype PersistentObject
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9124", {"PersistentObject", name}): ownedAttribute.forAll( a | a.type != null);
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9125", {"PersistentObject", name}): ownedAttribute.forAll( a | a.name.length > 0);
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9128", {"PersistentObject", name}): ownedOperation.forAll( e | e.hasReturnType() == true);
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9129", {"PersistentObject", name}): ownedOperation.forAll( e | e.name.length > 0);
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9127", {"PersistentObject", name}): ownedOperation.forAll( e | e.areAllInputParametersNamed() == true);
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9130", {"PersistentObject", name}): ownedOperation.forAll( e | e.hasOnlySupportedParamaterTypes());
context PersistentObject if runChecks("PersistentObject") ERROR this.getErrorMessage("9133", {name, classID.toString()}): classID > 0;
context Property if isNavigable() && class != null && class.isStereotypeApplied("PersistentObject") && runChecks() ERROR this.getErrorMessage("9135", {class.name, type.name}):	!isUnnamed();

context PersistentObject if runChecks("PersistentObject") WARNING this.getWarningMessage("9122", {"PersistentObject", name}): ownedComment.size  > 0;


// Checks for stereotype Role
context Role if runChecks("Role") && opposite != null ERROR this.getErrorMessage("9134", {((NamedElement)this.owner).name + "." + name, ((NamedElement)opposite.owner).name + "." + opposite.name}): opposite.isStereotypeApplied("Role") == true;
context Role if isMultivalued() && opposite.isMultivalued() && runChecks("Role") 
	ERROR "Error: " + class.fqn()+ "->"+ type.fqn() + ": The tag linkTable must be set to only one association end of of an association. Not setting it is not allowed." :
	isTableValid();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy