ManageableEntityLogic.java
// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.metafacades.emf.uml22;
import java.util.Collection;
import java.util.List;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.ActorFacade;
import org.andromda.metafacades.uml.ManageableEntity;
import org.andromda.metafacades.uml.ManageableEntityAssociationEnd;
import org.andromda.metafacades.uml.ManageableEntityAttribute;
import org.andromda.metafacades.uml.ModelElementFacade;
import org.apache.log4j.Logger;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager implementation.
* MetafacadeLogic for ManageableEntity
*
* @see ManageableEntity
*/
public abstract class ManageableEntityLogic
extends EntityLogicImpl
implements ManageableEntity
{
/**
* The underlying UML object
* @see Object
*/
protected Object metaObject;
/** Create Metafacade implementation instance using the MetafacadeFactory from the context
* @param metaObjectIn
* @param context
*/
protected ManageableEntityLogic(Object metaObjectIn, String context)
{
super(metaObjectIn, getContext(context));
this.metaObject = metaObjectIn;
}
/**
* The logger instance.
*/
private static final Logger logger = Logger.getLogger(ManageableEntityLogic.class);
/**
* Gets the context for this metafacade logic instance.
* @param context String. Set to ManageableEntity if null
* @return context String
*/
private static String getContext(String context)
{
if (context == null)
{
context = "org.andromda.metafacades.uml.ManageableEntity";
}
return context;
}
/** Reset context only for non-root metafacades
* @param context
*/
@Override
public void resetMetafacadeContext(String context)
{
if (!this.contextRoot) // reset context only for non-root metafacades
{
context = getContext(context); // to have same value as in original constructor call
setMetafacadeContext (context);
}
}
/**
* @return boolean true always
* @see ManageableEntity
*/
public boolean isManageableEntityMetaType()
{
return true;
}
// --------------- attributes ---------------------
/**
* @see ManageableEntity#getManageablePackageName()
* @return String
*/
protected abstract String handleGetManageablePackageName();
private String __manageablePackageName1a;
private boolean __manageablePackageName1aSet = false;
/**
* The entity package name.
* @return (String)handleGetManageablePackageName()
*/
public final String getManageablePackageName()
{
String manageablePackageName1a = this.__manageablePackageName1a;
if (!this.__manageablePackageName1aSet)
{
// manageablePackageName has no pre constraints
manageablePackageName1a = handleGetManageablePackageName();
// manageablePackageName has no post constraints
this.__manageablePackageName1a = manageablePackageName1a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageablePackageName1aSet = true;
}
}
return manageablePackageName1a;
}
/**
* @see ManageableEntity#getManageableServiceAccessorCall()
* @return String
*/
protected abstract String handleGetManageableServiceAccessorCall();
private String __manageableServiceAccessorCall2a;
private boolean __manageableServiceAccessorCall2aSet = false;
/**
* The entity accessor (getter) call.
* @return (String)handleGetManageableServiceAccessorCall()
*/
public final String getManageableServiceAccessorCall()
{
String manageableServiceAccessorCall2a = this.__manageableServiceAccessorCall2a;
if (!this.__manageableServiceAccessorCall2aSet)
{
// manageableServiceAccessorCall has no pre constraints
manageableServiceAccessorCall2a = handleGetManageableServiceAccessorCall();
// manageableServiceAccessorCall has no post constraints
this.__manageableServiceAccessorCall2a = manageableServiceAccessorCall2a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageableServiceAccessorCall2aSet = true;
}
}
return manageableServiceAccessorCall2a;
}
/**
* @see ManageableEntity#isRead()
* @return boolean
*/
protected abstract boolean handleIsRead();
private boolean __read3a;
private boolean __read3aSet = false;
/**
* Create a read operation on the entity manager?
* @return (boolean)handleIsRead()
*/
public final boolean isRead()
{
boolean read3a = this.__read3a;
if (!this.__read3aSet)
{
// read has no pre constraints
read3a = handleIsRead();
// read has no post constraints
this.__read3a = read3a;
if (isMetafacadePropertyCachingEnabled())
{
this.__read3aSet = true;
}
}
return read3a;
}
/**
* @see ManageableEntity#isCreate()
* @return boolean
*/
protected abstract boolean handleIsCreate();
private boolean __create4a;
private boolean __create4aSet = false;
/**
* Create a create operation on the entity manager?
* @return (boolean)handleIsCreate()
*/
public final boolean isCreate()
{
boolean create4a = this.__create4a;
if (!this.__create4aSet)
{
// create has no pre constraints
create4a = handleIsCreate();
// create has no post constraints
this.__create4a = create4a;
if (isMetafacadePropertyCachingEnabled())
{
this.__create4aSet = true;
}
}
return create4a;
}
/**
* @see ManageableEntity#isUpdate()
* @return boolean
*/
protected abstract boolean handleIsUpdate();
private boolean __update5a;
private boolean __update5aSet = false;
/**
* Create an update operation on the entity manager?
* @return (boolean)handleIsUpdate()
*/
public final boolean isUpdate()
{
boolean update5a = this.__update5a;
if (!this.__update5aSet)
{
// update has no pre constraints
update5a = handleIsUpdate();
// update has no post constraints
this.__update5a = update5a;
if (isMetafacadePropertyCachingEnabled())
{
this.__update5aSet = true;
}
}
return update5a;
}
/**
* @see ManageableEntity#isDelete()
* @return boolean
*/
protected abstract boolean handleIsDelete();
private boolean __delete6a;
private boolean __delete6aSet = false;
/**
* Create a delete operation on the entity manager?
* @return (boolean)handleIsDelete()
*/
public final boolean isDelete()
{
boolean delete6a = this.__delete6a;
if (!this.__delete6aSet)
{
// delete has no pre constraints
delete6a = handleIsDelete();
// delete has no post constraints
this.__delete6a = delete6a;
if (isMetafacadePropertyCachingEnabled())
{
this.__delete6aSet = true;
}
}
return delete6a;
}
/**
* @see ManageableEntity#getManageablePackagePath()
* @return String
*/
protected abstract String handleGetManageablePackagePath();
private String __manageablePackagePath7a;
private boolean __manageablePackagePath7aSet = false;
/**
* The Package path of the Entity
* @return (String)handleGetManageablePackagePath()
*/
public final String getManageablePackagePath()
{
String manageablePackagePath7a = this.__manageablePackagePath7a;
if (!this.__manageablePackagePath7aSet)
{
// manageablePackagePath has no pre constraints
manageablePackagePath7a = handleGetManageablePackagePath();
// manageablePackagePath has no post constraints
this.__manageablePackagePath7a = manageablePackagePath7a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageablePackagePath7aSet = true;
}
}
return manageablePackagePath7a;
}
/**
* @see ManageableEntity#getManageableServiceName()
* @return String
*/
protected abstract String handleGetManageableServiceName();
private String __manageableServiceName8a;
private boolean __manageableServiceName8aSet = false;
/**
* The service name of the entity.
* @return (String)handleGetManageableServiceName()
*/
public final String getManageableServiceName()
{
String manageableServiceName8a = this.__manageableServiceName8a;
if (!this.__manageableServiceName8aSet)
{
// manageableServiceName has no pre constraints
manageableServiceName8a = handleGetManageableServiceName();
// manageableServiceName has no post constraints
this.__manageableServiceName8a = manageableServiceName8a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageableServiceName8aSet = true;
}
}
return manageableServiceName8a;
}
/**
* @see ManageableEntity#getFullyQualifiedManageableServiceName()
* @return String
*/
protected abstract String handleGetFullyQualifiedManageableServiceName();
private String __fullyQualifiedManageableServiceName9a;
private boolean __fullyQualifiedManageableServiceName9aSet = false;
/**
* The fully qualified service name of the entity.
* @return (String)handleGetFullyQualifiedManageableServiceName()
*/
public final String getFullyQualifiedManageableServiceName()
{
String fullyQualifiedManageableServiceName9a = this.__fullyQualifiedManageableServiceName9a;
if (!this.__fullyQualifiedManageableServiceName9aSet)
{
// fullyQualifiedManageableServiceName has no pre constraints
fullyQualifiedManageableServiceName9a = handleGetFullyQualifiedManageableServiceName();
// fullyQualifiedManageableServiceName has no post constraints
this.__fullyQualifiedManageableServiceName9a = fullyQualifiedManageableServiceName9a;
if (isMetafacadePropertyCachingEnabled())
{
this.__fullyQualifiedManageableServiceName9aSet = true;
}
}
return fullyQualifiedManageableServiceName9a;
}
/**
* @see ManageableEntity#getManageableServiceFullPath()
* @return String
*/
protected abstract String handleGetManageableServiceFullPath();
private String __manageableServiceFullPath10a;
private boolean __manageableServiceFullPath10aSet = false;
/**
* The service full path of the entity.
* @return (String)handleGetManageableServiceFullPath()
*/
public final String getManageableServiceFullPath()
{
String manageableServiceFullPath10a = this.__manageableServiceFullPath10a;
if (!this.__manageableServiceFullPath10aSet)
{
// manageableServiceFullPath has no pre constraints
manageableServiceFullPath10a = handleGetManageableServiceFullPath();
// manageableServiceFullPath has no post constraints
this.__manageableServiceFullPath10a = manageableServiceFullPath10a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageableServiceFullPath10aSet = true;
}
}
return manageableServiceFullPath10a;
}
/**
* @see ManageableEntity#getManageableMembers()
* @return List<ModelElementFacade>
*/
protected abstract List<ModelElementFacade> handleGetManageableMembers();
private List<ModelElementFacade> __manageableMembers11a;
private boolean __manageableMembers11aSet = false;
/**
* ManageableAttributes and ManageableAssociationEnds
* @return (List<ModelElementFacade>)handleGetManageableMembers()
*/
public final List<ModelElementFacade> getManageableMembers()
{
List<ModelElementFacade> manageableMembers11a = this.__manageableMembers11a;
if (!this.__manageableMembers11aSet)
{
// manageableMembers has no pre constraints
manageableMembers11a = handleGetManageableMembers();
// manageableMembers has no post constraints
this.__manageableMembers11a = manageableMembers11a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageableMembers11aSet = true;
}
}
return manageableMembers11a;
}
/**
* @see ManageableEntity#isManageable()
* @return boolean
*/
protected abstract boolean handleIsManageable();
private boolean __manageable12a;
private boolean __manageable12aSet = false;
/**
* True: Entity is manageable.
* @return (boolean)handleIsManageable()
*/
public final boolean isManageable()
{
boolean manageable12a = this.__manageable12a;
if (!this.__manageable12aSet)
{
// manageable has no pre constraints
manageable12a = handleIsManageable();
// manageable has no post constraints
this.__manageable12a = manageable12a;
if (isMetafacadePropertyCachingEnabled())
{
this.__manageable12aSet = true;
}
}
return manageable12a;
}
/**
* @see ManageableEntity#getMaximumListSize()
* @return int
*/
protected abstract int handleGetMaximumListSize();
private int __maximumListSize13a;
private boolean __maximumListSize13aSet = false;
/**
* The maximum number of rows to load from the database.
* @return (int)handleGetMaximumListSize()
*/
public final int getMaximumListSize()
{
int maximumListSize13a = this.__maximumListSize13a;
if (!this.__maximumListSize13aSet)
{
// maximumListSize has no pre constraints
maximumListSize13a = handleGetMaximumListSize();
// maximumListSize has no post constraints
this.__maximumListSize13a = maximumListSize13a;
if (isMetafacadePropertyCachingEnabled())
{
this.__maximumListSize13aSet = true;
}
}
return maximumListSize13a;
}
/**
* @see ManageableEntity#getPageSize()
* @return int
*/
protected abstract int handleGetPageSize();
private int __pageSize14a;
private boolean __pageSize14aSet = false;
/**
* The maximum number of rows to load from the database.
* @return (int)handleGetPageSize()
*/
public final int getPageSize()
{
int pageSize14a = this.__pageSize14a;
if (!this.__pageSize14aSet)
{
// pageSize has no pre constraints
pageSize14a = handleGetPageSize();
// pageSize has no post constraints
this.__pageSize14a = pageSize14a;
if (isMetafacadePropertyCachingEnabled())
{
this.__pageSize14aSet = true;
}
}
return pageSize14a;
}
/**
* @see ManageableEntity#isResolveable()
* @return boolean
*/
protected abstract boolean handleIsResolveable();
private boolean __resolveable15a;
private boolean __resolveable15aSet = false;
/**
* The maximum number of rows to load from the database.
* @return (boolean)handleIsResolveable()
*/
public final boolean isResolveable()
{
boolean resolveable15a = this.__resolveable15a;
if (!this.__resolveable15aSet)
{
// resolveable has no pre constraints
resolveable15a = handleIsResolveable();
// resolveable has no post constraints
this.__resolveable15a = resolveable15a;
if (isMetafacadePropertyCachingEnabled())
{
this.__resolveable15aSet = true;
}
}
return resolveable15a;
}
// ---------------- business methods ----------------------
/**
* Method to be implemented in descendants
* Returns a string with the attributes without wrapper types.
* @param withTypes
* @return String
*/
protected abstract String handleListManageableMembers(boolean withTypes);
/**
* Returns a string with the attributes without wrapper types.
* @param withTypes boolean
* TODO: Model Documentation for
* ManageableEntity.listManageableMembers(withTypes)
* @return handleListManageableMembers(withTypes)
*/
public String listManageableMembers(boolean withTypes)
{
// listManageableMembers has no pre constraints
String returnValue = handleListManageableMembers(withTypes);
// listManageableMembers has no post constraints
return returnValue;
}
/**
* Method to be implemented in descendants
* Returns a string with the attributes and wrapper types.
* @return String
*/
protected abstract String handleListManageableMembersWithWrapperTypes();
/**
* Returns a string with the attributes and wrapper types.
* @return handleListManageableMembersWithWrapperTypes()
*/
public String listManageableMembersWithWrapperTypes()
{
// listManageableMembersWithWrapperTypes has no pre constraints
String returnValue = handleListManageableMembersWithWrapperTypes();
// listManageableMembersWithWrapperTypes has no post constraints
return returnValue;
}
// ------------- associations ------------------
private List<ActorFacade> __getUsers1r;
private boolean __getUsers1rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (List<ActorFacade>)handleGetUsers()
*/
public final List<ActorFacade> getUsers()
{
List<ActorFacade> getUsers1r = this.__getUsers1r;
if (!this.__getUsers1rSet)
{
// manageableEntity has no pre constraints
List result = handleGetUsers();
List shieldedResult = this.shieldedElements(result);
try
{
getUsers1r = (List<ActorFacade>)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getUsers List<ActorFacade> " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getUsers1r = getUsers1r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getUsers1rSet = true;
}
}
return getUsers1r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return List
*/
protected abstract List handleGetUsers();
private List<ManageableEntityAssociationEnd> __getManageableAssociationEnds2r;
private boolean __getManageableAssociationEnds2rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (List<ManageableEntityAssociationEnd>)handleGetManageableAssociationEnds()
*/
public final List<ManageableEntityAssociationEnd> getManageableAssociationEnds()
{
List<ManageableEntityAssociationEnd> getManageableAssociationEnds2r = this.__getManageableAssociationEnds2r;
if (!this.__getManageableAssociationEnds2rSet)
{
// manageableEntity has no pre constraints
List result = handleGetManageableAssociationEnds();
List shieldedResult = this.shieldedElements(result);
try
{
getManageableAssociationEnds2r = (List<ManageableEntityAssociationEnd>)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableAssociationEnds List<ManageableEntityAssociationEnd> " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getManageableAssociationEnds2r = getManageableAssociationEnds2r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getManageableAssociationEnds2rSet = true;
}
}
return getManageableAssociationEnds2r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return List
*/
protected abstract List handleGetManageableAssociationEnds();
private ManageableEntityAttribute __getDisplayAttribute3r;
private boolean __getDisplayAttribute3rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (ManageableEntityAttribute)handleGetDisplayAttribute()
*/
public final ManageableEntityAttribute getDisplayAttribute()
{
ManageableEntityAttribute getDisplayAttribute3r = this.__getDisplayAttribute3r;
if (!this.__getDisplayAttribute3rSet)
{
// manageableEntity has no pre constraints
Object result = handleGetDisplayAttribute();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getDisplayAttribute3r = (ManageableEntityAttribute)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getDisplayAttribute ManageableEntityAttribute " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getDisplayAttribute3r = getDisplayAttribute3r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getDisplayAttribute3rSet = true;
}
}
return getDisplayAttribute3r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetDisplayAttribute();
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (List<ManageableEntity>)handleGetReferencingManageables()
*/
public final List<ManageableEntity> getReferencingManageables()
{
List<ManageableEntity> getReferencingManageables4r = null;
// manageableEntity has no pre constraints
List result = handleGetReferencingManageables();
List shieldedResult = this.shieldedElements(result);
try
{
getReferencingManageables4r = (List<ManageableEntity>)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getReferencingManageables List<ManageableEntity> " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
return getReferencingManageables4r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return List
*/
protected abstract List handleGetReferencingManageables();
private List<ManageableEntity> __getAllManageables5r;
private boolean __getAllManageables5rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (List<ManageableEntity>)handleGetAllManageables()
*/
public final List<ManageableEntity> getAllManageables()
{
List<ManageableEntity> getAllManageables5r = this.__getAllManageables5r;
if (!this.__getAllManageables5rSet)
{
// manageableEntity has no pre constraints
List result = handleGetAllManageables();
List shieldedResult = this.shieldedElements(result);
try
{
getAllManageables5r = (List<ManageableEntity>)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getAllManageables List<ManageableEntity> " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getAllManageables5r = getAllManageables5r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getAllManageables5rSet = true;
}
}
return getAllManageables5r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return List
*/
protected abstract List handleGetAllManageables();
private List<ManageableEntityAttribute> __getManageableAttributes6r;
private boolean __getManageableAttributes6rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (List<ManageableEntityAttribute>)handleGetManageableAttributes()
*/
public final List<ManageableEntityAttribute> getManageableAttributes()
{
List<ManageableEntityAttribute> getManageableAttributes6r = this.__getManageableAttributes6r;
if (!this.__getManageableAttributes6rSet)
{
// manageableEntity has no pre constraints
List result = handleGetManageableAttributes();
List shieldedResult = this.shieldedElements(result);
try
{
getManageableAttributes6r = (List<ManageableEntityAttribute>)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableAttributes List<ManageableEntityAttribute> " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getManageableAttributes6r = getManageableAttributes6r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getManageableAttributes6rSet = true;
}
}
return getManageableAttributes6r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return List
*/
protected abstract List handleGetManageableAttributes();
private ManageableEntityAttribute __getManageableIdentifier7r;
private boolean __getManageableIdentifier7rSet = false;
/**
* An Entity that is Manageable: will produce CRUD operations in the EntityManager
* implementation.
* @return (ManageableEntityAttribute)handleGetManageableIdentifier()
*/
public final ManageableEntityAttribute getManageableIdentifier()
{
ManageableEntityAttribute getManageableIdentifier7r = this.__getManageableIdentifier7r;
if (!this.__getManageableIdentifier7rSet)
{
// manageableEntity has no pre constraints
Object result = handleGetManageableIdentifier();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getManageableIdentifier7r = (ManageableEntityAttribute)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableIdentifier ManageableEntityAttribute " + result + ": " + shieldedResult);
}
// manageableEntity has no post constraints
this.__getManageableIdentifier7r = getManageableIdentifier7r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getManageableIdentifier7rSet = true;
}
}
return getManageableIdentifier7r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetManageableIdentifier();
/**
* @param validationMessages Collection<ModelValidationMessage>
* @see EntityLogicImpl#validateInvariants(Collection validationMessages)
*/
@Override
public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
{
super.validateInvariants(validationMessages);
}
}