From: Vance K. <va...@us...> - 2006-01-03 01:36:38
|
User: vancek Date: 06/01/02 17:36:31 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: renamed fetch type and generator type constants Revision Changes Path 1.2 +8 -6 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3EntityAttributeFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3EntityAttributeFacadeLogicImpl.java 3 Jan 2006 01:36:31 -0000 1.2 @@ -1,5 +1,8 @@ package org.andromda.cartridges.ejb3.metafacades; +import java.util.Collection; +import java.util.Iterator; + import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.apache.commons.lang.StringUtils; @@ -57,7 +60,7 @@ boolean isEager = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_EAGER)) + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_EAGER)) { isEager = true; } @@ -73,7 +76,7 @@ boolean isLazy = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_LAZY)) { + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_LAZY)) { isLazy = true; } } @@ -113,7 +116,7 @@ genType = String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_TYPE)); if (StringUtils.isBlank(genType)) { - genType = EJB3Profile.GENERATORTYPE_AUTO; + genType = EJB3Globals.GENERATOR_TYPE_AUTO; } } return genType; @@ -158,7 +161,7 @@ boolean isSequence = false; if (StringUtils.isNotBlank(this.getGeneratorType())) { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Profile.GENERATORTYPE_SEQUENCE)) + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_SEQUENCE)) { isSequence = true; } @@ -174,7 +177,7 @@ boolean isTable = false; if (StringUtils.isNotBlank(this.getGeneratorType())) { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Profile.GENERATORTYPE_TABLE)) + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_TABLE)) { isTable = true; } @@ -320,5 +323,4 @@ } return isTransient; } - } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-18 09:19:17
|
User: vancek Date: 06/01/18 01:19:11 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: fixed getGeneratorType to default to NONE for Date, Time and String types, renamed isSequenceGeneratorType to isGeneratorTypeSequence, renamed isTableGeneratorType to isGeneratorTypeTable Revision Changes Path 1.4 +42 -35 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- EJB3EntityAttributeFacadeLogicImpl.java 6 Jan 2006 13:56:17 -0000 1.3 +++ EJB3EntityAttributeFacadeLogicImpl.java 18 Jan 2006 09:19:11 -0000 1.4 @@ -105,16 +105,55 @@ String genType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_GENERATOR_TYPE); if (StringUtils.isBlank(genType)) { + if (this.getType().isStringType() || this.getType().isDateType() || this.getType().isTimeType()) + { + genType = EJB3Globals.GENERATOR_TYPE_NONE; + } + else + { genType = String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_TYPE)); if (StringUtils.isBlank(genType)) { genType = EJB3Globals.GENERATOR_TYPE_AUTO; } } + } return genType; } /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsSequenceGeneratorType() + */ + protected boolean handleIsGeneratorTypeSequence() + { + boolean isSequence = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_SEQUENCE)) + { + isSequence = true; + } + } + return isSequence; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsTableGeneratorType() + */ + protected boolean handleIsGeneratorTypeTable() + { + boolean isTable = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_TABLE)) + { + isTable = true; + } + } + return isTable; + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetGeneratorName() */ protected String handleGetGeneratorName() @@ -146,38 +185,6 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsSequenceGeneratorType() - */ - protected boolean handleIsSequenceGeneratorType() - { - boolean isSequence = false; - if (StringUtils.isNotBlank(this.getGeneratorType())) - { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_SEQUENCE)) - { - isSequence = true; - } - } - return isSequence; - } - - /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsTableGeneratorType() - */ - protected boolean handleIsTableGeneratorType() - { - boolean isTable = false; - if (StringUtils.isNotBlank(this.getGeneratorType())) - { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_TABLE)) - { - isTable = true; - } - } - return isTable; - } - - /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetGeneratorInitialValue() */ protected int handleGetGeneratorInitialValue() |
From: Vance K. <va...@us...> - 2006-01-23 05:52:06
|
User: vancek Date: 06/01/22 21:51:55 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: added generatorTypeAuto, generatorTypeNone and generatorTypeIdentity Revision Changes Path 1.5 +48 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- EJB3EntityAttributeFacadeLogicImpl.java 18 Jan 2006 09:19:11 -0000 1.4 +++ EJB3EntityAttributeFacadeLogicImpl.java 23 Jan 2006 05:51:55 -0000 1.5 @@ -154,6 +154,54 @@ } /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsGeneratorTypeAuto() + */ + protected boolean handleIsGeneratorTypeAuto() + { + boolean isAuto = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_AUTO)) + { + isAuto = true; + } + } + return isAuto; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsGeneratorTypeNone() + */ + protected boolean handleIsGeneratorTypeNone() + { + boolean isNone = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_NONE)) + { + isNone = true; + } + } + return isNone; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsGeneratorTypeIdentity() + */ + protected boolean handleIsGeneratorTypeIdentity() + { + boolean isIdentity = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_IDENTITY)) + { + isIdentity = true; + } + } + return isIdentity; + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetGeneratorName() */ protected String handleGetGeneratorName() |
From: Vance K. <va...@us...> - 2006-01-25 02:59:56
|
User: vancek Date: 06/01/24 18:59:49 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: update getColumnDefinition to return a schema definition if the attribute type is an enumeration and the literals are string based, moved static variables from EJB3Globals to here Revision Changes Path 1.6 +58 -8 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- EJB3EntityAttributeFacadeLogicImpl.java 23 Jan 2006 05:51:55 -0000 1.5 +++ EJB3EntityAttributeFacadeLogicImpl.java 25 Jan 2006 02:59:49 -0000 1.6 @@ -5,6 +5,7 @@ import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; +import org.andromda.metafacades.uml.AttributeFacade; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; @@ -18,6 +19,26 @@ extends EJB3EntityAttributeFacadeLogic { + /** + * The property that stores the default entity ID generator type + */ + public static final String ENTITY_DEFAULT_GENERATOR_TYPE = "entityDefaultGeneratorType"; + + /** + * The property that stores the default generator initial value + */ + public static final String ENTITY_DEFAULT_GENERATOR_INITIAL_VALUE = "entityDefaultGeneratorInitialValue"; + + /** + * The property that stores the default generator allocation size for incrementing ids + */ + public static final String ENTITY_DEFAULT_GENERATOR_ALLOCATION_SIZE = "entityDefaultGeneratorAllocationSize"; + + /** + * The property that stores the default enumeration string literal column length. + */ + public static final String DEFAULT_ENUM_LITERAL_COLUMN_LENGTH = "entityDefaultEnumLiteralColumnLength"; + // ---------------- constructor ------------------------------- public EJB3EntityAttributeFacadeLogicImpl (Object metaObject, String context) @@ -111,7 +132,7 @@ } else { - genType = String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_TYPE)); + genType = String.valueOf(this.getConfiguredProperty(ENTITY_DEFAULT_GENERATOR_TYPE)); if (StringUtils.isBlank(genType)) { genType = EJB3Globals.GENERATOR_TYPE_AUTO; @@ -242,15 +263,15 @@ (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_GENERATOR_INITIAL_VALUE); if (StringUtils.isNotBlank(initialValueStr)) { - initialValue = NumberUtils.stringToInt(initialValueStr); + initialValue = NumberUtils.toInt(initialValueStr); } else { initialValueStr = - String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_INITIAL_VALUE)); + String.valueOf(this.getConfiguredProperty(ENTITY_DEFAULT_GENERATOR_INITIAL_VALUE)); if (StringUtils.isNotBlank(initialValueStr)) { - initialValue = NumberUtils.stringToInt(initialValueStr); + initialValue = NumberUtils.toInt(initialValueStr); } } @@ -267,15 +288,15 @@ (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_GENERATOR_ALLOCATION_SIZE); if (StringUtils.isNotBlank(allocationSizeStr)) { - allocationSize = NumberUtils.stringToInt(allocationSizeStr); + allocationSize = NumberUtils.toInt(allocationSizeStr); } else { allocationSizeStr = - String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_ALLOCATION_SIZE)); + String.valueOf(this.getConfiguredProperty(ENTITY_DEFAULT_GENERATOR_ALLOCATION_SIZE)); if (StringUtils.isNotBlank(allocationSizeStr)) { - allocationSize = NumberUtils.stringToInt(allocationSizeStr); + allocationSize = NumberUtils.toInt(allocationSizeStr); } } @@ -316,10 +337,39 @@ /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetColumnDefinition() + * + * If the column definition has not manually been set and the attribute + * type is an enumeration, work out the schema from the length and type + * of the enumeration literals. The definition is only set for if the + * literal types are String. */ protected String handleGetColumnDefinition() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION); + String definition = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION); + if (StringUtils.isBlank(definition) && this.getType().isEnumeration()) + { + boolean isOrdinal = false; + int length = NumberUtils.toInt( + String.valueOf(this.getConfiguredProperty(DEFAULT_ENUM_LITERAL_COLUMN_LENGTH))); + for (final Iterator iter = this.getType().getAttributes().iterator(); iter.hasNext(); ) + { + AttributeFacade attribute = (AttributeFacade)iter.next(); + if (!attribute.getType().isStringType()) + { + isOrdinal = true; + break; + } + if (attribute.getName().length() > length) + { + length = attribute.getName().length(); + } + } + if (!isOrdinal) + { + definition = "VARCHAR(" + length + ") NOT NULL"; + } + } + return definition; } /** |
From: Vance K. <va...@us...> - 2006-01-28 02:59:52
|
User: vancek Date: 06/01/27 18:59:46 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: override isRequired to cater for inheritance, utilise isRequired in isColumnNullable using multiplicity if no tagged value exists. Revision Changes Path 1.7 +19 -1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- EJB3EntityAttributeFacadeLogicImpl.java 25 Jan 2006 02:59:49 -0000 1.6 +++ EJB3EntityAttributeFacadeLogicImpl.java 28 Jan 2006 02:59:46 -0000 1.7 @@ -64,6 +64,24 @@ return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_FETCH_TYPE); } + /** + * Overridden to provide handling of inheritance. + * + * @see org.andromda.metafacades.uml.AttributeFacade#isRequired() + */ + public boolean isRequired() + { + boolean required = super.isRequired(); + if (this.getOwner() instanceof EJB3EntityFacade) + { + EJB3EntityFacade entity = (EJB3EntityFacade)this.getOwner(); + if (entity.isInheritanceSingleTable() && entity.getGeneralization() != null) + { + required = false; + } + } + return required; + } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsEager() @@ -398,7 +416,7 @@ if (StringUtils.isBlank(nullableString)) { - nullable = (this.isIdentifier() || this.isUnique() ? false : true); + nullable = (this.isIdentifier() || this.isUnique() ? false : !this.isRequired()); } else { |
From: Vance K. <va...@us...> - 2006-01-31 15:25:20
|
User: vancek Date: 06/01/31 07:25:10 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: overriden getDefaultValue to put double quotes around string values Revision Changes Path 1.8 +33 -8 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- EJB3EntityAttributeFacadeLogicImpl.java 28 Jan 2006 02:59:46 -0000 1.7 +++ EJB3EntityAttributeFacadeLogicImpl.java 31 Jan 2006 15:25:10 -0000 1.8 @@ -6,6 +6,7 @@ import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.andromda.metafacades.uml.AttributeFacade; +import org.andromda.metafacades.uml.ClassifierFacade; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; @@ -57,14 +58,6 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade#getFetchType() - */ - protected String handleGetFetchType() - { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_FETCH_TYPE); - } - - /** * Overridden to provide handling of inheritance. * * @see org.andromda.metafacades.uml.AttributeFacade#isRequired() @@ -84,6 +77,38 @@ } /** + * Override to provide java specific handling of the default value. + * + * @see org.andromda.metafacades.uml.AttributeFacade#getDefaultValue() + */ + public String getDefaultValue() + { + String defaultValue = super.getDefaultValue(); + final ClassifierFacade type = this.getType(); + if (type != null) + { + final String fullyQualifiedName = StringUtils.trimToEmpty(type.getFullyQualifiedName()); + if (type.isStringType()) + { + defaultValue = "\"" + defaultValue + "\""; + } + else if (fullyQualifiedName.startsWith("java.lang")) + { + defaultValue = fullyQualifiedName + ".valueOf(" + defaultValue + ")"; + } + } + return defaultValue; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade#getFetchType() + */ + protected String handleGetFetchType() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_FETCH_TYPE); + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsEager() */ protected boolean handleIsEager() |
From: Vance K. <va...@us...> - 2006-02-06 04:02:38
|
User: vancek Date: 06/02/05 20:02:32 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: changed getLobType to isLob added getTemporalType and getEnumerationType Revision Changes Path 1.9 +19 -3 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- EJB3EntityAttributeFacadeLogicImpl.java 31 Jan 2006 15:25:10 -0000 1.8 +++ EJB3EntityAttributeFacadeLogicImpl.java 6 Feb 2006 04:02:32 -0000 1.9 @@ -154,11 +154,11 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade#getLobType() + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade#isLob() */ - protected String handleGetLobType() + protected boolean handleIsLob() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_LOB_TYPE); + return this.hasStereotype(EJB3Profile.STEREOTYPE_LOB); } /** @@ -463,4 +463,20 @@ } return isTransient; } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetTemporalType() + */ + protected String handleGetTemporalType() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_TEMPORAL_TYPE); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetEnumerationType() + */ + protected String handleGetEnumerationType() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_ENUMERATION_TYPE); + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-02-09 07:16:56
|
User: vancek Date: 06/02/08 23:16:50 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: added isInsertEnabled and isUpdateEnabled implementations Revision Changes Path 1.10 +18 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- EJB3EntityAttributeFacadeLogicImpl.java 6 Feb 2006 04:02:32 -0000 1.9 +++ EJB3EntityAttributeFacadeLogicImpl.java 9 Feb 2006 07:16:50 -0000 1.10 @@ -479,4 +479,22 @@ { return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_ENUMERATION_TYPE); } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsInsertEnabled() + */ + protected boolean handleIsInsertEnabled() + { + final String value = (String)findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_COLUMN_INSERT); + return StringUtils.isNotBlank(value) ? Boolean.valueOf(value).booleanValue() : true; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsUpdateEnabled() + */ + protected boolean handleIsUpdateEnabled() + { + final String value = (String)findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_COLUMN_UPDATE); + return StringUtils.isNotBlank(value) ? Boolean.valueOf(value).booleanValue() : true; + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-03-16 02:15:14
|
User: vancek Date: 06/03/15 18:15:04 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: removed isTransient implementation. Revision Changes Path 1.11 +0 -14 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- EJB3EntityAttributeFacadeLogicImpl.java 9 Feb 2006 07:16:50 -0000 1.10 +++ EJB3EntityAttributeFacadeLogicImpl.java 16 Mar 2006 02:15:02 -0000 1.11 @@ -451,20 +451,6 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsTransient() - */ - protected boolean handleIsTransient() - { - boolean isTransient = false; - - if (this.hasStereotype(EJB3Profile.STEREOTYPE_TRANSIENT)) - { - isTransient = true; - } - return isTransient; - } - - /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetTemporalType() */ protected String handleGetTemporalType() |
From: Vance K. <va...@us...> - 2006-03-16 15:31:33
|
User: vancek Date: 06/03/16 07:31:29 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: refactored handleIsLob implementation to check if attribute type is blob or clob. implemented handleGetLobType to find tagged value from @andromda.persistence.lob.type. Revision Changes Path 1.12 +9 -2 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -r1.11 -r1.12 --- EJB3EntityAttributeFacadeLogicImpl.java 16 Mar 2006 02:15:02 -0000 1.11 +++ EJB3EntityAttributeFacadeLogicImpl.java 16 Mar 2006 15:31:29 -0000 1.12 @@ -145,7 +145,6 @@ protected boolean handleIsVersion() { boolean isVersion = false; - if (this.hasStereotype(EJB3Profile.STEREOTYPE_VERSION)) { isVersion = true; @@ -158,7 +157,15 @@ */ protected boolean handleIsLob() { - return this.hasStereotype(EJB3Profile.STEREOTYPE_LOB); + return this.getType().isBlobType() || this.getType().isClobType(); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetLobType() + */ + protected String handleGetLobType() + { + return StringUtils.trimToEmpty((String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_LOB_TYPE)); } /** |
From: Vance K. <va...@us...> - 2006-04-24 02:47:37
|
User: vancek Date: 06/04/23 19:47:36 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: implemented handleIsContainsEmbeddedObject Revision Changes Path 1.13 +13 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- EJB3EntityAttributeFacadeLogicImpl.java 16 Mar 2006 15:31:29 -0000 1.12 +++ EJB3EntityAttributeFacadeLogicImpl.java 24 Apr 2006 02:47:36 -0000 1.13 @@ -490,4 +490,17 @@ final String value = (String)findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_COLUMN_UPDATE); return StringUtils.isNotBlank(value) ? Boolean.valueOf(value).booleanValue() : true; } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsContainsEmbeddedObject() + */ + protected boolean handleIsContainsEmbeddedObject() + { + boolean returnValue = false; + if (this.getType() instanceof EJB3EmbeddedValueFacade) + { + returnValue = true; + } + return returnValue; + } } \ No newline at end of file |