001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.ejb.metafacades; 006 007import java.util.Collection; 008import org.andromda.core.metafacade.ModelValidationMessage; 009 010/** 011 * TODO: Model Documentation for org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade 012 * MetafacadeLogic for EJBPrimaryKeyFacade 013 * 014 * @see EJBPrimaryKeyFacade 015 */ 016public abstract class EJBPrimaryKeyFacadeLogic 017 extends EJBEntityAttributeFacadeLogicImpl 018 implements EJBPrimaryKeyFacade 019{ 020 /** 021 * The underlying UML object 022 * @see Object 023 */ 024 protected Object metaObject; 025 026 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 027 * @param metaObjectIn 028 * @param context 029 */ 030 protected EJBPrimaryKeyFacadeLogic(Object metaObjectIn, String context) 031 { 032 super(metaObjectIn, getContext(context)); 033 this.metaObject = metaObjectIn; 034 } 035 036 /** 037 * Gets the context for this metafacade logic instance. 038 * @param context String. Set to EJBPrimaryKeyFacade if null 039 * @return context String 040 */ 041 private static String getContext(String context) 042 { 043 if (context == null) 044 { 045 context = "org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade"; 046 } 047 return context; 048 } 049 050 /** Reset context only for non-root metafacades 051 * @param context 052 */ 053 @Override 054 public void resetMetafacadeContext(String context) 055 { 056 if (!this.contextRoot) // reset context only for non-root metafacades 057 { 058 context = getContext(context); // to have same value as in original constructor call 059 setMetafacadeContext (context); 060 } 061 } 062 063 /** 064 * @return boolean true always 065 * @see EJBPrimaryKeyFacade 066 */ 067 public boolean isEJBPrimaryKeyFacadeMetaType() 068 { 069 return true; 070 } 071 072 // --------------- attributes --------------------- 073 074 /** 075 * @see org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade#isComplex() 076 * @return boolean 077 */ 078 protected abstract boolean handleIsComplex(); 079 080 private boolean __complex1a; 081 private boolean __complex1aSet = false; 082 083 /** 084 * True/false on whether or not the primary key is complex. 085 * @return (boolean)handleIsComplex() 086 */ 087 public final boolean isComplex() 088 { 089 boolean complex1a = this.__complex1a; 090 if (!this.__complex1aSet) 091 { 092 // complex has no pre constraints 093 complex1a = handleIsComplex(); 094 // complex has no post constraints 095 this.__complex1a = complex1a; 096 if (isMetafacadePropertyCachingEnabled()) 097 { 098 this.__complex1aSet = true; 099 } 100 } 101 return complex1a; 102 } 103 104 /** 105 * @param validationMessages Collection<ModelValidationMessage> 106 * @see EJBEntityAttributeFacadeLogicImpl#validateInvariants(Collection validationMessages) 107 */ 108 @Override 109 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 110 { 111 super.validateInvariants(validationMessages); 112 } 113}