From: Vance K. <va...@us...> - 2006-01-18 09:16:52
|
User: vancek Date: 06/01/18 01:16:46 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3ScriptHelper.java Log: updated filterUpdatableAttributes method to remove identifier attributes for an entity with a composite primary key class Revision Changes Path 1.3 +6 -3 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java Index: EJB3ScriptHelper.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- EJB3ScriptHelper.java 3 Jan 2006 01:33:44 -0000 1.2 +++ EJB3ScriptHelper.java 18 Jan 2006 09:16:46 -0000 1.3 @@ -1,6 +1,7 @@ package org.andromda.cartridges.ejb3; import org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade; +import org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade; import org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ModelElementFacade; @@ -58,18 +59,20 @@ /** * Filter a list of EntityAttributes by removing all non-updatable attributes. - * This filter currently removes all attributes that are of stereotype Version. + * This filter currently removes all attributes that are of stereotype Version + * and identifier attributes for an entity with a composite primary key class. * * @param list The original list + * @param isCompositePK True if entity has a composite primary key * @return Collection A list of EntityAttributes from the original list that are updatable */ - public Collection filterUpdatableAttributes(Collection list) + public Collection filterUpdatableAttributes(Collection list, boolean isCompositePK) { Collection retval = new ArrayList(list.size()); for (final Iterator iter = list.iterator(); iter.hasNext(); ) { EJB3EntityAttributeFacade attr = (EJB3EntityAttributeFacade)iter.next(); - if (!attr.isVersion()) + if (!attr.isVersion() && ((isCompositePK && !attr.isIdentifier()) || !isCompositePK)) { retval.add(attr); } |