================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.37 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.37 Tue Apr 25 16:07:56 2006 *************** *** 370,376 **** /** * INTERNAL: * Method to return an owner mapping. It will tell the owner class to ! * process itself if it hasn't already done so. */ protected DatabaseMapping getOwningMapping(MetadataAccessor accessor) { String ownerAttributeName = accessor.getMappedBy(); --- 370,376 ---- /** * INTERNAL: * Method to return an owner mapping. It will tell the owner class to ! * process itself it hasn't already done so. */ protected DatabaseMapping getOwningMapping(MetadataAccessor accessor) { String ownerAttributeName = accessor.getMappedBy(); *************** *** 380,385 **** --- 380,386 ---- // If no mapping was found, there is an error in the mappedBy field, // therefore, throw an exception. Allow processing of relationship // mappings where the target-entity is not defined in XML. + if (mapping == null) { getValidator().throwNoMappedByAttributeFound(ownerDmd.getJavaClass(), ownerAttributeName, accessor.getJavaClass(), accessor.getAttributeName()); } *************** *** 1247,1289 **** // Add the mapping to the descriptor. accessor.getMetadataDescriptor().addMapping(mapping); } /** * INTERNAL: * Process a MapKey for a 1-M or M-M mapping. Will return the map key * method name that should be use, null otherwise. */ ! protected String processMapKey(CollectionMapping mapping, MetadataAccessor accessor) { ! String mapKey = null; ! ! if (accessor.isMapCollectionAccessor()) { ! MetadataDescriptor referenceDmd = accessor.getReferenceMetadataDescriptor(); ! if (accessor.getMapKey().equals("") && referenceDmd.hasCompositePrimaryKey()) { ! // No persistent property or field name has been provided, and ! // the reference class has a composite primary key class. Let ! // it fall through to return null for the map key. Internally, ! // TopLink will use an instance of the composite primary key ! // class as the map key. ! } else { ! // A persistent property or field name may have have been ! // provided. If one has not we will default to the primary ! // key of the reference class. The primary key cannot be ! // composite at this point. ! String fieldOrPropertyName = getName(accessor.getMapKey(), referenceDmd.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME, accessor); ! // Look up the referenceAccessor ! MetadataAccessor referenceAccessor = referenceDmd.getAccessorFor(fieldOrPropertyName); ! ! if (referenceAccessor == null) { ! getValidator().throwCouldNotFindMapKey(fieldOrPropertyName, referenceDmd.getJavaClass(), mapping); ! } ! mapKey = referenceAccessor.getName(); } } ! return mapKey; } /** --- 1248,1292 ---- // Add the mapping to the descriptor. accessor.getMetadataDescriptor().addMapping(mapping); } + + /** + * INTERNAL: + */ + protected abstract String processMapKey(CollectionMapping mapping, MetadataAccessor accessor); /** * INTERNAL: * Process a MapKey for a 1-M or M-M mapping. Will return the map key * method name that should be use, null otherwise. */ ! protected String processMapKey(CollectionMapping mapping, String name, MetadataAccessor accessor) { ! MetadataDescriptor referenceDmd = accessor.getReferenceMetadataDescriptor(); ! String mapKeyName = null; ! if (name.equals("") && referenceDmd.hasCompositePrimaryKey()) { ! // No persistent property or field name has been provided, and ! // the reference class has a composite primary key class. Let ! // it fall through to return null for the map key. Internally, ! // TopLink will use an instance of the composite primary key ! // class as the map key. ! } else { ! // A persistent property or field name may have have been ! // provided. If one has not we will default to the primary ! // key of the reference class. The primary key cannot be ! // composite at this point. ! String fieldOrPropertyName = getName(name, referenceDmd.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME, accessor); ! // Look up the referenceAccessor ! MetadataAccessor referenceAccessor = referenceDmd.getAccessorFor(fieldOrPropertyName); ! if (referenceAccessor == null) { ! getValidator().throwCouldNotFindMapKey(fieldOrPropertyName, referenceDmd.getJavaClass(), mapping); } + + mapKeyName = referenceAccessor.getName(); } ! return mapKeyName; } /** *************** *** 1695,1705 **** md.setPrimaryTable(dbTable); } /** * INTERNAL: ! * Process a temporal type accessor. */ ! protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor) { Class entityClass = accessor.getJavaClass(); Class referenceClass = accessor.getReferenceClass(); String attributeName = accessor.getAttributeName(); --- 1698,1715 ---- md.setPrimaryTable(dbTable); } + /** + * INTERNAL: + */ + protected abstract void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor); + /** * INTERNAL: ! * Process a temporal type. The method may still be called if no @Temporal ! * or temporal sub-element has been specified but the accessor's reference ! * class is a valid temporal type. */ ! protected void processTemporal(DirectToFieldMapping mapping, String temporalType, MetadataAccessor accessor) { Class entityClass = accessor.getJavaClass(); Class referenceClass = accessor.getReferenceClass(); String attributeName = accessor.getAttributeName(); *************** *** 1707,1713 **** if (MetadataHelper.isValidTemporalType(referenceClass)) { // Set a TypeConversionConverter on the mapping. mapping.setConverter(new TypeConversionConverter(mapping)); ! mapping.setFieldClassification(MetadataHelper.getFieldClassification(accessor.getTemporalType())); } else { getValidator().throwInvalidTypeForTemporalAttribute(entityClass, attributeName, referenceClass); } --- 1717,1723 ---- if (MetadataHelper.isValidTemporalType(referenceClass)) { // Set a TypeConversionConverter on the mapping. mapping.setConverter(new TypeConversionConverter(mapping)); ! mapping.setFieldClassification(MetadataHelper.getFieldClassification(temporalType)); } else { getValidator().throwInvalidTypeForTemporalAttribute(entityClass, attributeName, referenceClass); } ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataDescriptor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.31 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataDescriptor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.31 Tue Apr 25 16:08:35 2006 *************** *** 309,334 **** /** * INTERNAL: - * This method will first check for an accessor with name equal to - * fieldOrPropertyName (that is, assumes it is a field name). If no accessor - * is found than it assumes fieldOrPropertyName is a property name and - * converts it to its corresponding field name and looks for the accessor - * again. If still no accessor is found and this descriptor metadata is - * and an inheritance sublcass, than it will then look on the root metadata - * descriptor. Null is returned otherwise. */ public MetadataAccessor getAccessorFor(String fieldOrPropertyName) { MetadataAccessor accessor = (MetadataAccessor) m_accessors.get(fieldOrPropertyName); if (accessor == null) { ! // Perhaps we have a property name ... ! accessor = (MetadataAccessor) m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName)); ! ! // If still no accessor and we are an inheritance subclass, check ! // the root descriptor now. ! if (accessor == null && isInheritanceSubclass()) { ! accessor = getInheritanceRootDmd().getAccessorFor(fieldOrPropertyName); ! } } return accessor; --- 309,320 ---- /** * INTERNAL: */ public MetadataAccessor getAccessorFor(String fieldOrPropertyName) { MetadataAccessor accessor = (MetadataAccessor) m_accessors.get(fieldOrPropertyName); if (accessor == null) { ! return (MetadataAccessor) m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName)); } return accessor; ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Company.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.5 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Company.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.5 Tue Apr 25 16:51:57 2006 *************** *** 37,43 **** private Number id; private String name; private Collection vehicles; - private Set engineers; public Company() { vehicles = new Vector(); --- 37,42 ---- *************** *** 61,75 **** this.id = id; } - @OneToMany(mappedBy="company") - public Set getEngineers() { - return engineers; - } - - public void setEngineers(Set engineers) { - this.engineers = engineers; - } - @OneToMany(cascade=ALL, mappedBy="owner") public Collection getVehicles() { return vehicles; --- 60,65 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/InheritanceTableCreator.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.8 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/InheritanceTableCreator.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.8 Tue Apr 25 17:02:23 2006 *************** *** 317,334 **** fieldTITLE.setShouldAllowNull(true); table.addField(fieldTITLE); - FieldDefinition fieldCOMPANY_ID = new FieldDefinition(); - fieldCOMPANY_ID.setName("COMPANY_ID"); - fieldCOMPANY_ID.setTypeName("NUMBER"); - fieldCOMPANY_ID.setSize(15); - fieldCOMPANY_ID.setSubSize(0); - fieldCOMPANY_ID.setIsPrimaryKey(false); - fieldCOMPANY_ID.setIsIdentity(false); - fieldCOMPANY_ID.setUnique(false); - fieldCOMPANY_ID.setShouldAllowNull(true); - fieldCOMPANY_ID.setForeignKeyFieldName("CMP3_COMPANY.ID"); - table.addField(fieldCOMPANY_ID); - return table; } --- 317,322 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Engineer.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.4 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Engineer.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.4 Tue Apr 25 17:04:23 2006 *************** *** 31,53 **** @DiscriminatorValue("E") public class Engineer extends Person { private String title; - private Company company; ! @ManyToOne ! public Company getCompany() { ! return company; ! } ! ! @Column(name="TITLE") public String getTitle() { return title; } - public void setCompany(Company company) { - this.company = company; - } - public void setTitle(String title) { this.title = title; } ! } --- 31,43 ---- @DiscriminatorValue("E") public class Engineer extends Person { private String title; ! @Column(name="TITLE") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } ! } \ No newline at end of file ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataHelper.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.42 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataHelper.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.42 Tue Apr 25 17:25:09 2006 *************** *** 98,115 **** /** * INTERNAL: ! * Method to convert a getXyz or isXyz method name to an xyz attribute name. ! * NOTE: The method name passed it may not actually be a method name, so ! * by default return the name passed in. */ public static String getAttributeNameFromMethodName(String methodName) { ! String leadingChar = ""; ! String restOfName = methodName; if (methodName.startsWith(GET_PROPERTY_METHOD_PREFIX)) { leadingChar = methodName.substring(POSITION_AFTER_GET_PREFIX, POSITION_AFTER_GET_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_GET_PREFIX + 1); ! } else if (methodName.startsWith(IS_PROPERTY_METHOD_PREFIX)){ leadingChar = methodName.substring(POSITION_AFTER_IS_PREFIX, POSITION_AFTER_IS_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_IS_PREFIX + 1); } --- 98,112 ---- /** * INTERNAL: ! * Method to convert a getXyz or isXyz method name to an xyz attribute name. */ public static String getAttributeNameFromMethodName(String methodName) { ! String leadingChar, restOfName; if (methodName.startsWith(GET_PROPERTY_METHOD_PREFIX)) { leadingChar = methodName.substring(POSITION_AFTER_GET_PREFIX, POSITION_AFTER_GET_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_GET_PREFIX + 1); ! } else { leadingChar = methodName.substring(POSITION_AFTER_IS_PREFIX, POSITION_AFTER_IS_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_IS_PREFIX + 1); } ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000009/AB0952363AC40CBFE034080020E8C54E.7 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000009/AB0952363AC40CBFE034080020E8C54E.7 Wed Apr 26 09:56:08 2006 *************** *** 21,27 **** // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata; - import java.util.Map; import java.lang.Boolean; /** --- 21,26 ---- *************** *** 84,95 **** /** * INTERNAL: - * Return the order by value on this accessor. - */ - public abstract String getMapKey(); - - /** - * INTERNAL: * Return the mapped by attribute for this accessor. This method is * supported by all relational accessors except for many-to-one. */ --- 83,88 ---- *************** *** 147,158 **** /** * INTERNAL: - * Return the temporal type for this accessor. - */ - public abstract String getTemporalType(); - - /** - * INTERNAL: * Return the upper cased attribute name for this accessor. Used when * defaulting. */ --- 140,145 ---- *************** *** 254,267 **** * Return true if this accessor represents a m-1 relationship. */ public abstract boolean isManyToOne(); - - /** - * INTERNAL: - * Return true if this accessor uses a Map. - */ - public boolean isMapCollectionAccessor() { - return getRawClass().equals(Map.class); - } /** * INTERNAL: --- 241,246 ---- *************** *** 316,326 **** * Return true if this accessor represents a temporal mapping. */ public boolean isTemporal() { ! if (MetadataHelper.isValidTemporalType(getReferenceClass()) && ! hasTemporal()) { ! m_metadataProcessor.getValidator().throwNoTemporalTypeSpecified(getJavaClass(), getAttributeName()); ! } ! ! return hasTemporal(); } /** --- 295,301 ---- * Return true if this accessor represents a temporal mapping. */ public boolean isTemporal() { ! return hasTemporal() || MetadataHelper.isValidTemporalType(getReferenceClass()); } /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000010/AB0952363AC40CBFE034080020E8C54E.32 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000010/AB0952363AC40CBFE034080020E8C54E.32 Wed Apr 26 10:00:15 2006 *************** *** 30,38 **** --- 30,41 ---- import javax.persistence.Lob; import javax.persistence.Column; import javax.persistence.Version; + import javax.persistence.OrderBy; import javax.persistence.Temporal; import javax.persistence.Enumerated; import javax.persistence.EmbeddedId; + import javax.persistence.JoinColumn; + import javax.persistence.JoinColumns; import javax.persistence.SqlResultSetMapping; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.PrimaryKeyJoinColumns; *************** *** 103,123 **** /** * INTERNAL: ! * Method to return a map key for a collection mapping. ! */ ! public String getMapKey() { ! // WIP - Throw an exception here since it is only supported on ! // collection accessors. ! return ""; ! } ! ! /** ! * INTERNAL: ! * Return the mapped by attribute for this accessor. */ public String getMappedBy() { - // WIP - Throw an exception here since it is only supported on - // collection accessors. return ""; } --- 106,115 ---- /** * INTERNAL: ! * Return the mapped by attribute for this accessor. This method is ! * supported by all relational accessors except for many-to-one. */ public String getMappedBy() { return ""; } *************** *** 144,152 **** * called to check if one exists. */ public String getOrderBy() { ! // WIP - Throw an exception here since it is only supported on ! // collection accessors. ! return ""; } /** --- 136,143 ---- * called to check if one exists. */ public String getOrderBy() { ! OrderBy orderBy = getAnnotation(OrderBy.class); ! return orderBy.value(); } /** *************** *** 177,201 **** /** * INTERNAL: ! * Return the target entity for this accessor. */ public Class getTargetEntity() { - // WIP - Throw an exception here since it is only supported on - // collection accessors. return null; } /** * INTERNAL: - * Return the temporal type for this accessor. Assumes there is a @Temporal. - */ - public String getTemporalType() { - Temporal temporal = getAnnotation(Temporal.class); - return temporal.value().name(); - } - - /** - * INTERNAL: * Method to check if an annotated element has @Column. */ public boolean hasColumn() { --- 168,182 ---- /** * INTERNAL: ! * Return the target entity for this accessor. This method is supported by ! * all relational accessors. */ public Class getTargetEntity() { return null; } /** * INTERNAL: * Method to check if an annotated element has @Column. */ public boolean hasColumn() { *************** *** 215,223 **** * Method to check if an annotated element has a @JoinColumn. */ public boolean hasJoinColumn() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on relationship accessors. ! return false; } /** --- 196,202 ---- * Method to check if an annotated element has a @JoinColumn. */ public boolean hasJoinColumn() { ! return isAnnotationPresent(JoinColumn.class); } /** *************** *** 225,243 **** * Method to check if an annotated element has a @JoinColumns. */ public boolean hasJoinColumns() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on relationship accessors. ! return false; } ! /** * INTERNAL: * Method to check if this accessor has an @OrderBy. */ public boolean hasOrderBy() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on collection accessors. ! return false; } /** --- 204,218 ---- * Method to check if an annotated element has a @JoinColumns. */ public boolean hasJoinColumns() { ! return isAnnotationPresent(JoinColumns.class); } ! /** * INTERNAL: * Method to check if this accessor has an @OrderBy. */ public boolean hasOrderBy() { ! return isAnnotationPresent(OrderBy.class); } /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/OneToManyAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000011/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/OneToManyAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000011/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:08:09 2006 *************** *** 36,42 **** * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class OneToManyAccessor extends AnnotationsCollectionAccessor { OneToMany m_oneToMany; /** --- 36,42 ---- * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class OneToManyAccessor extends AnnotationsRelationshipAccessor { OneToMany m_oneToMany; /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/ManyToManyAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000012/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/ManyToManyAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000012/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:10:20 2006 *************** *** 34,40 **** * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class ManyToManyAccessor extends AnnotationsCollectionAccessor { ManyToMany m_manyToMany; /** --- 34,40 ---- * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class ManyToManyAccessor extends AnnotationsRelationshipAccessor { ManyToMany m_manyToMany; /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsCollectionAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000014/AB0952363AC40CBFE034080020E8C54E.0 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsCollectionAccessor.java Wed Apr 26 13:07:45 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000014/AB0952363AC40CBFE034080020E8C54E.0 Wed Apr 26 13:49:21 2006 *************** *** 1,77 **** - /* - * The contents of this file are subject to the terms - * of the Common Development and Distribution License - * (the "License"). You may not use this file except - * in compliance with the License. - * - * You can obtain a copy of the license at - * glassfish/bootstrap/legal/CDDLv1.0.txt or - * https://glassfish.dev.java.net/public/CDDLv1.0.html. - * See the License for the specific language governing - * permissions and limitations under the License. - * - * When distributing Covered Code, include this CDDL - * HEADER in each file and include the License file at - * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, - * add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your - * own identifying information: Portions Copyright [yyyy] - * [name of copyright owner] - */ - // Copyright (c) 1998, 2006, Oracle. All rights reserved. - package oracle.toplink.essentials.internal.ejb.cmp3.annotations.accessors; - - import java.util.Map; - - import javax.persistence.MapKey; - import javax.persistence.OrderBy; - - import oracle.toplink.essentials.internal.ejb.cmp3.annotations.AnnotationsDescriptor; - import oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor; - - /** - * An annotation defined relational collections accessor. - * - * @author Guy Pelletier - * @since TopLink EJB 3.0 Reference Implementation - */ - public class AnnotationsCollectionAccessor extends AnnotationsRelationshipAccessor { - /** - * INTERNAL: - */ - public AnnotationsCollectionAccessor(AnnotatedAccessibleObject accessibleObject, EJBAnnotationsProcessor processor, AnnotationsDescriptor descriptor) { - super(accessibleObject, processor, descriptor); - } - - /** - * INTERNAL: - * Method to return a map key for a collection mapping. Assumes hasMapKey() - * has been called before asking for the map key name. - */ - public String getMapKey() { - if (isAnnotationPresent(MapKey.class)) { - MapKey mapKey = getAnnotation(MapKey.class); - return mapKey.name(); - } else { - return ""; - } - } - - /** - * INTERNAL: - * Return the order by value on this accessor. Assumes hasOrderBy() has been - * called before asking for the order by value. - */ - public String getOrderBy() { - OrderBy orderBy = getAnnotation(OrderBy.class); - return orderBy.value(); - } - - /** - * INTERNAL: - * Method to check if this accessor has an @OrderBy. - */ - public boolean hasOrderBy() { - return isAnnotationPresent(OrderBy.class); - } - } --- 0 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/EJBAnnotationsProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000015/AB0952363AC40CBFE034080020E8C54E.120 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/EJBAnnotationsProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000015/AB0952363AC40CBFE034080020E8C54E.120 Wed Apr 26 10:36:39 2006 *************** *** 1287,1292 **** --- 1287,1304 ---- /** * INTERNAL: + * Process a @MapKey for a 1-M or M-M mapping. Will return the map key name + * that should be used. + */ + protected String processMapKey(CollectionMapping mapping, MetadataAccessor accessor) { + MapKey mapKey = AnnotationsHelper.getAnnotation(MapKey.class, accessor); + String mapKeyName = (mapKey == null) ? "" : mapKey.name(); + + return processMapKey(mapping, mapKeyName, accessor); + } + + /** + * INTERNAL: * Process a @NamedNativeQueries. The method will also look for * a @NamedNativeQuery. This method currently only stores the queries if * there are some. The actually query processing isn't done till *************** *** 1806,1811 **** --- 1818,1839 ---- /** * INTERNAL: + * Process a @Temporal. The method may still be called if no @Temporal + * has been specified but the accessor's reference class is a valid + * temporal type. + */ + protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor) { + Temporal temporal = AnnotationsHelper.getAnnotation(Temporal.class, accessor); + + if (temporal == null) { + getValidator().throwNoTemporalTypeSpecified(accessor.getJavaClass(), accessor.getAttributeName()); + } else { + processTemporal(mapping, temporal.value().name(), accessor); + } + } + + /** + * INTERNAL: * Process a @UniqueConstraint(s) for the given table. */ protected void processUniqueConstraints(Object[] constraints, DatabaseTable table) { ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/EntityMappingsXMLProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000016/AB0952363AC40CBFE034080020E8C54E.97 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/EntityMappingsXMLProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000016/AB0952363AC40CBFE034080020E8C54E.97 Wed Apr 26 10:36:54 2006 *************** *** 1856,1861 **** --- 1856,1876 ---- xmlDmd.setEntityEventListener(listener); } } + + /** + * INTERNAL: + * Process map-key for a one-to-many or many-to-many mapping. + * @return the map key method name that should be used, null otherwise + */ + protected String processMapKey(CollectionMapping mapping, MetadataAccessor metadataAccessor) { + XMLAccessor accessor = (XMLAccessor) metadataAccessor; + + if (!accessor.hasMapKey()) { + return null; + } + + return processMapKey(mapping, accessor.getMapKey(), accessor); + } /** * INTERNAL: *************** *** 2446,2451 **** --- 2461,2479 ---- } } } + + /** + * INTERNAL: + */ + protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor metadataAccessor) { + XMLAccessor accessor = (XMLAccessor) metadataAccessor; + + if (accessor.hasTemporal()) { + processTemporal(mapping, accessor.getTemporalNode().getNodeValue(), accessor); + } else { + getValidator().throwNoTemporalTypeSpecified(accessor.getJavaClass(), accessor.getAttributeName()); + } + } /** * INTERNAL: ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsRelationshipAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000017/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsRelationshipAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000017/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:59:05 2006 *************** *** 23,30 **** import javax.persistence.FetchType; import javax.persistence.CascadeType; - import javax.persistence.JoinColumn; - import javax.persistence.JoinColumns; import oracle.toplink.essentials.internal.ejb.cmp3.annotations.AnnotationsDescriptor; import oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor; --- 23,28 ---- *************** *** 85,106 **** /** * INTERNAL: - * Method to check if an annotated element has a @JoinColumn. - */ - public boolean hasJoinColumn() { - return isAnnotationPresent(JoinColumn.class); - } - - /** - * INTERNAL: - * Method to check if an annotated element has a @JoinColumns. - */ - public boolean hasJoinColumns() { - return isAnnotationPresent(JoinColumns.class); - } - - /** - * INTERNAL: */ protected void setCascadeTypes(CascadeType[] cascadeTypes) { m_cascadeTypes = cascadeTypes; --- 83,88 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/XMLAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000018/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Wed Apr 26 13:08:11 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/XMLAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000018/AB0952363AC40CBFE034080020E8C54E.14 Wed Apr 26 11:47:11 2006 *************** *** 253,262 **** * INTERNAL: */ public String getMapKey() { String mapKey = ""; - Node mapKeyNode = getMapKeyNode(); ! if (mapKeyNode != null && mapKeyNode.getNodeValue() != null) { mapKey = mapKeyNode.getNodeValue(); } --- 253,262 ---- * INTERNAL: */ public String getMapKey() { + Node mapKeyNode = getMapKeyNode(); String mapKey = ""; ! if (mapKeyNode.getNodeValue() != null) { mapKey = mapKeyNode.getNodeValue(); } *************** *** 396,410 **** /** * INTERNAL: - * Return the temporal type for this accessor. Assumes there is a temporal - * node. - */ - public String getTemporalType() { - return getTemporalNode().getNodeValue(); - } - - /** - * INTERNAL: */ public boolean hasAttributeOverrides() { return getAttributeOverrideNodes() != null; --- 396,401 ---- *************** *** 460,465 **** --- 451,464 ---- NodeList joinColumnNodes = m_xPathEngine.selectNodes(m_node, new String[] {XMLConstants.JOIN_COLUMN}); return (joinColumnNodes != null && joinColumnNodes.getLength() > 1); } + + /** + * INTERNAL: + * Method to check if m_node has a map-key sub-element. + */ + public boolean hasMapKey() { + return getMapKeyNode() != null; + } /** * INTERNAL: ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.37 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.37 Tue Apr 25 16:07:56 2006 *************** *** 370,376 **** /** * INTERNAL: * Method to return an owner mapping. It will tell the owner class to ! * process itself if it hasn't already done so. */ protected DatabaseMapping getOwningMapping(MetadataAccessor accessor) { String ownerAttributeName = accessor.getMappedBy(); --- 370,376 ---- /** * INTERNAL: * Method to return an owner mapping. It will tell the owner class to ! * process itself it hasn't already done so. */ protected DatabaseMapping getOwningMapping(MetadataAccessor accessor) { String ownerAttributeName = accessor.getMappedBy(); *************** *** 380,385 **** --- 380,386 ---- // If no mapping was found, there is an error in the mappedBy field, // therefore, throw an exception. Allow processing of relationship // mappings where the target-entity is not defined in XML. + if (mapping == null) { getValidator().throwNoMappedByAttributeFound(ownerDmd.getJavaClass(), ownerAttributeName, accessor.getJavaClass(), accessor.getAttributeName()); } *************** *** 1247,1289 **** // Add the mapping to the descriptor. accessor.getMetadataDescriptor().addMapping(mapping); } /** * INTERNAL: * Process a MapKey for a 1-M or M-M mapping. Will return the map key * method name that should be use, null otherwise. */ ! protected String processMapKey(CollectionMapping mapping, MetadataAccessor accessor) { ! String mapKey = null; ! ! if (accessor.isMapCollectionAccessor()) { ! MetadataDescriptor referenceDmd = accessor.getReferenceMetadataDescriptor(); ! if (accessor.getMapKey().equals("") && referenceDmd.hasCompositePrimaryKey()) { ! // No persistent property or field name has been provided, and ! // the reference class has a composite primary key class. Let ! // it fall through to return null for the map key. Internally, ! // TopLink will use an instance of the composite primary key ! // class as the map key. ! } else { ! // A persistent property or field name may have have been ! // provided. If one has not we will default to the primary ! // key of the reference class. The primary key cannot be ! // composite at this point. ! String fieldOrPropertyName = getName(accessor.getMapKey(), referenceDmd.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME, accessor); ! // Look up the referenceAccessor ! MetadataAccessor referenceAccessor = referenceDmd.getAccessorFor(fieldOrPropertyName); ! ! if (referenceAccessor == null) { ! getValidator().throwCouldNotFindMapKey(fieldOrPropertyName, referenceDmd.getJavaClass(), mapping); ! } ! mapKey = referenceAccessor.getName(); } } ! return mapKey; } /** --- 1248,1292 ---- // Add the mapping to the descriptor. accessor.getMetadataDescriptor().addMapping(mapping); } + + /** + * INTERNAL: + */ + protected abstract String processMapKey(CollectionMapping mapping, MetadataAccessor accessor); /** * INTERNAL: * Process a MapKey for a 1-M or M-M mapping. Will return the map key * method name that should be use, null otherwise. */ ! protected String processMapKey(CollectionMapping mapping, String name, MetadataAccessor accessor) { ! MetadataDescriptor referenceDmd = accessor.getReferenceMetadataDescriptor(); ! String mapKeyName = null; ! if (name.equals("") && referenceDmd.hasCompositePrimaryKey()) { ! // No persistent property or field name has been provided, and ! // the reference class has a composite primary key class. Let ! // it fall through to return null for the map key. Internally, ! // TopLink will use an instance of the composite primary key ! // class as the map key. ! } else { ! // A persistent property or field name may have have been ! // provided. If one has not we will default to the primary ! // key of the reference class. The primary key cannot be ! // composite at this point. ! String fieldOrPropertyName = getName(name, referenceDmd.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME, accessor); ! // Look up the referenceAccessor ! MetadataAccessor referenceAccessor = referenceDmd.getAccessorFor(fieldOrPropertyName); ! if (referenceAccessor == null) { ! getValidator().throwCouldNotFindMapKey(fieldOrPropertyName, referenceDmd.getJavaClass(), mapping); } + + mapKeyName = referenceAccessor.getName(); } ! return mapKeyName; } /** *************** *** 1695,1705 **** md.setPrimaryTable(dbTable); } /** * INTERNAL: ! * Process a temporal type accessor. */ ! protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor) { Class entityClass = accessor.getJavaClass(); Class referenceClass = accessor.getReferenceClass(); String attributeName = accessor.getAttributeName(); --- 1698,1715 ---- md.setPrimaryTable(dbTable); } + /** + * INTERNAL: + */ + protected abstract void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor); + /** * INTERNAL: ! * Process a temporal type. The method may still be called if no @Temporal ! * or temporal sub-element has been specified but the accessor's reference ! * class is a valid temporal type. */ ! protected void processTemporal(DirectToFieldMapping mapping, String temporalType, MetadataAccessor accessor) { Class entityClass = accessor.getJavaClass(); Class referenceClass = accessor.getReferenceClass(); String attributeName = accessor.getAttributeName(); *************** *** 1707,1713 **** if (MetadataHelper.isValidTemporalType(referenceClass)) { // Set a TypeConversionConverter on the mapping. mapping.setConverter(new TypeConversionConverter(mapping)); ! mapping.setFieldClassification(MetadataHelper.getFieldClassification(accessor.getTemporalType())); } else { getValidator().throwInvalidTypeForTemporalAttribute(entityClass, attributeName, referenceClass); } --- 1717,1723 ---- if (MetadataHelper.isValidTemporalType(referenceClass)) { // Set a TypeConversionConverter on the mapping. mapping.setConverter(new TypeConversionConverter(mapping)); ! mapping.setFieldClassification(MetadataHelper.getFieldClassification(temporalType)); } else { getValidator().throwInvalidTypeForTemporalAttribute(entityClass, attributeName, referenceClass); } ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataDescriptor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.31 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataDescriptor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.31 Tue Apr 25 16:08:35 2006 *************** *** 309,334 **** /** * INTERNAL: - * This method will first check for an accessor with name equal to - * fieldOrPropertyName (that is, assumes it is a field name). If no accessor - * is found than it assumes fieldOrPropertyName is a property name and - * converts it to its corresponding field name and looks for the accessor - * again. If still no accessor is found and this descriptor metadata is - * and an inheritance sublcass, than it will then look on the root metadata - * descriptor. Null is returned otherwise. */ public MetadataAccessor getAccessorFor(String fieldOrPropertyName) { MetadataAccessor accessor = (MetadataAccessor) m_accessors.get(fieldOrPropertyName); if (accessor == null) { ! // Perhaps we have a property name ... ! accessor = (MetadataAccessor) m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName)); ! ! // If still no accessor and we are an inheritance subclass, check ! // the root descriptor now. ! if (accessor == null && isInheritanceSubclass()) { ! accessor = getInheritanceRootDmd().getAccessorFor(fieldOrPropertyName); ! } } return accessor; --- 309,320 ---- /** * INTERNAL: */ public MetadataAccessor getAccessorFor(String fieldOrPropertyName) { MetadataAccessor accessor = (MetadataAccessor) m_accessors.get(fieldOrPropertyName); if (accessor == null) { ! return (MetadataAccessor) m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName)); } return accessor; ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Company.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.5 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Company.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.5 Tue Apr 25 16:51:57 2006 *************** *** 37,43 **** private Number id; private String name; private Collection vehicles; - private Set engineers; public Company() { vehicles = new Vector(); --- 37,42 ---- *************** *** 61,75 **** this.id = id; } - @OneToMany(mappedBy="company") - public Set getEngineers() { - return engineers; - } - - public void setEngineers(Set engineers) { - this.engineers = engineers; - } - @OneToMany(cascade=ALL, mappedBy="owner") public Collection getVehicles() { return vehicles; --- 60,65 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/InheritanceTableCreator.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.8 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/InheritanceTableCreator.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.8 Tue Apr 25 17:02:23 2006 *************** *** 317,334 **** fieldTITLE.setShouldAllowNull(true); table.addField(fieldTITLE); - FieldDefinition fieldCOMPANY_ID = new FieldDefinition(); - fieldCOMPANY_ID.setName("COMPANY_ID"); - fieldCOMPANY_ID.setTypeName("NUMBER"); - fieldCOMPANY_ID.setSize(15); - fieldCOMPANY_ID.setSubSize(0); - fieldCOMPANY_ID.setIsPrimaryKey(false); - fieldCOMPANY_ID.setIsIdentity(false); - fieldCOMPANY_ID.setUnique(false); - fieldCOMPANY_ID.setShouldAllowNull(true); - fieldCOMPANY_ID.setForeignKeyFieldName("CMP3_COMPANY.ID"); - table.addField(fieldCOMPANY_ID); - return table; } --- 317,322 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Engineer.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.4 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/inheritance/Engineer.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.4 Tue Apr 25 17:04:23 2006 *************** *** 31,53 **** @DiscriminatorValue("E") public class Engineer extends Person { private String title; - private Company company; ! @ManyToOne ! public Company getCompany() { ! return company; ! } ! ! @Column(name="TITLE") public String getTitle() { return title; } - public void setCompany(Company company) { - this.company = company; - } - public void setTitle(String title) { this.title = title; } ! } --- 31,43 ---- @DiscriminatorValue("E") public class Engineer extends Person { private String title; ! @Column(name="TITLE") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } ! } \ No newline at end of file ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataHelper.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.42 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataHelper.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.42 Tue Apr 25 17:25:09 2006 *************** *** 98,115 **** /** * INTERNAL: ! * Method to convert a getXyz or isXyz method name to an xyz attribute name. ! * NOTE: The method name passed it may not actually be a method name, so ! * by default return the name passed in. */ public static String getAttributeNameFromMethodName(String methodName) { ! String leadingChar = ""; ! String restOfName = methodName; if (methodName.startsWith(GET_PROPERTY_METHOD_PREFIX)) { leadingChar = methodName.substring(POSITION_AFTER_GET_PREFIX, POSITION_AFTER_GET_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_GET_PREFIX + 1); ! } else if (methodName.startsWith(IS_PROPERTY_METHOD_PREFIX)){ leadingChar = methodName.substring(POSITION_AFTER_IS_PREFIX, POSITION_AFTER_IS_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_IS_PREFIX + 1); } --- 98,112 ---- /** * INTERNAL: ! * Method to convert a getXyz or isXyz method name to an xyz attribute name. */ public static String getAttributeNameFromMethodName(String methodName) { ! String leadingChar, restOfName; if (methodName.startsWith(GET_PROPERTY_METHOD_PREFIX)) { leadingChar = methodName.substring(POSITION_AFTER_GET_PREFIX, POSITION_AFTER_GET_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_GET_PREFIX + 1); ! } else { leadingChar = methodName.substring(POSITION_AFTER_IS_PREFIX, POSITION_AFTER_IS_PREFIX + 1); restOfName = methodName.substring(POSITION_AFTER_IS_PREFIX + 1); } ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000009/AB0952363AC40CBFE034080020E8C54E.7 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000009/AB0952363AC40CBFE034080020E8C54E.7 Wed Apr 26 09:56:08 2006 *************** *** 21,27 **** // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata; - import java.util.Map; import java.lang.Boolean; /** --- 21,26 ---- *************** *** 84,95 **** /** * INTERNAL: - * Return the order by value on this accessor. - */ - public abstract String getMapKey(); - - /** - * INTERNAL: * Return the mapped by attribute for this accessor. This method is * supported by all relational accessors except for many-to-one. */ --- 83,88 ---- *************** *** 147,158 **** /** * INTERNAL: - * Return the temporal type for this accessor. - */ - public abstract String getTemporalType(); - - /** - * INTERNAL: * Return the upper cased attribute name for this accessor. Used when * defaulting. */ --- 140,145 ---- *************** *** 254,267 **** * Return true if this accessor represents a m-1 relationship. */ public abstract boolean isManyToOne(); - - /** - * INTERNAL: - * Return true if this accessor uses a Map. - */ - public boolean isMapCollectionAccessor() { - return getRawClass().equals(Map.class); - } /** * INTERNAL: --- 241,246 ---- *************** *** 316,326 **** * Return true if this accessor represents a temporal mapping. */ public boolean isTemporal() { ! if (MetadataHelper.isValidTemporalType(getReferenceClass()) && ! hasTemporal()) { ! m_metadataProcessor.getValidator().throwNoTemporalTypeSpecified(getJavaClass(), getAttributeName()); ! } ! ! return hasTemporal(); } /** --- 295,301 ---- * Return true if this accessor represents a temporal mapping. */ public boolean isTemporal() { ! return hasTemporal() || MetadataHelper.isValidTemporalType(getReferenceClass()); } /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000010/AB0952363AC40CBFE034080020E8C54E.32 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000010/AB0952363AC40CBFE034080020E8C54E.32 Wed Apr 26 10:00:15 2006 *************** *** 30,38 **** --- 30,41 ---- import javax.persistence.Lob; import javax.persistence.Column; import javax.persistence.Version; + import javax.persistence.OrderBy; import javax.persistence.Temporal; import javax.persistence.Enumerated; import javax.persistence.EmbeddedId; + import javax.persistence.JoinColumn; + import javax.persistence.JoinColumns; import javax.persistence.SqlResultSetMapping; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.PrimaryKeyJoinColumns; *************** *** 103,123 **** /** * INTERNAL: ! * Method to return a map key for a collection mapping. ! */ ! public String getMapKey() { ! // WIP - Throw an exception here since it is only supported on ! // collection accessors. ! return ""; ! } ! ! /** ! * INTERNAL: ! * Return the mapped by attribute for this accessor. */ public String getMappedBy() { - // WIP - Throw an exception here since it is only supported on - // collection accessors. return ""; } --- 106,115 ---- /** * INTERNAL: ! * Return the mapped by attribute for this accessor. This method is ! * supported by all relational accessors except for many-to-one. */ public String getMappedBy() { return ""; } *************** *** 144,152 **** * called to check if one exists. */ public String getOrderBy() { ! // WIP - Throw an exception here since it is only supported on ! // collection accessors. ! return ""; } /** --- 136,143 ---- * called to check if one exists. */ public String getOrderBy() { ! OrderBy orderBy = getAnnotation(OrderBy.class); ! return orderBy.value(); } /** *************** *** 177,201 **** /** * INTERNAL: ! * Return the target entity for this accessor. */ public Class getTargetEntity() { - // WIP - Throw an exception here since it is only supported on - // collection accessors. return null; } /** * INTERNAL: - * Return the temporal type for this accessor. Assumes there is a @Temporal. - */ - public String getTemporalType() { - Temporal temporal = getAnnotation(Temporal.class); - return temporal.value().name(); - } - - /** - * INTERNAL: * Method to check if an annotated element has @Column. */ public boolean hasColumn() { --- 168,182 ---- /** * INTERNAL: ! * Return the target entity for this accessor. This method is supported by ! * all relational accessors. */ public Class getTargetEntity() { return null; } /** * INTERNAL: * Method to check if an annotated element has @Column. */ public boolean hasColumn() { *************** *** 215,223 **** * Method to check if an annotated element has a @JoinColumn. */ public boolean hasJoinColumn() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on relationship accessors. ! return false; } /** --- 196,202 ---- * Method to check if an annotated element has a @JoinColumn. */ public boolean hasJoinColumn() { ! return isAnnotationPresent(JoinColumn.class); } /** *************** *** 225,243 **** * Method to check if an annotated element has a @JoinColumns. */ public boolean hasJoinColumns() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on relationship accessors. ! return false; } ! /** * INTERNAL: * Method to check if this accessor has an @OrderBy. */ public boolean hasOrderBy() { ! // WIP - Throw an exception if an annotation exists here. Only supported ! // on collection accessors. ! return false; } /** --- 204,218 ---- * Method to check if an annotated element has a @JoinColumns. */ public boolean hasJoinColumns() { ! return isAnnotationPresent(JoinColumns.class); } ! /** * INTERNAL: * Method to check if this accessor has an @OrderBy. */ public boolean hasOrderBy() { ! return isAnnotationPresent(OrderBy.class); } /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/OneToManyAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000011/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/OneToManyAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000011/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:08:09 2006 *************** *** 36,42 **** * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class OneToManyAccessor extends AnnotationsCollectionAccessor { OneToMany m_oneToMany; /** --- 36,42 ---- * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class OneToManyAccessor extends AnnotationsRelationshipAccessor { OneToMany m_oneToMany; /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/ManyToManyAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000012/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/ManyToManyAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000012/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:10:20 2006 *************** *** 34,40 **** * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class ManyToManyAccessor extends AnnotationsCollectionAccessor { ManyToMany m_manyToMany; /** --- 34,40 ---- * @author Guy Pelletier * @since TopLink 10.1.3/EJB 3.0 Preview */ ! public class ManyToManyAccessor extends AnnotationsRelationshipAccessor { ManyToMany m_manyToMany; /** ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsCollectionAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000014/AB0952363AC40CBFE034080020E8C54E.0 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsCollectionAccessor.java Wed Apr 26 13:07:45 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000014/AB0952363AC40CBFE034080020E8C54E.0 Wed Apr 26 13:49:21 2006 *************** *** 1,77 **** - /* - * The contents of this file are subject to the terms - * of the Common Development and Distribution License - * (the "License"). You may not use this file except - * in compliance with the License. - * - * You can obtain a copy of the license at - * glassfish/bootstrap/legal/CDDLv1.0.txt or - * https://glassfish.dev.java.net/public/CDDLv1.0.html. - * See the License for the specific language governing - * permissions and limitations under the License. - * - * When distributing Covered Code, include this CDDL - * HEADER in each file and include the License file at - * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, - * add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your - * own identifying information: Portions Copyright [yyyy] - * [name of copyright owner] - */ - // Copyright (c) 1998, 2006, Oracle. All rights reserved. - package oracle.toplink.essentials.internal.ejb.cmp3.annotations.accessors; - - import java.util.Map; - - import javax.persistence.MapKey; - import javax.persistence.OrderBy; - - import oracle.toplink.essentials.internal.ejb.cmp3.annotations.AnnotationsDescriptor; - import oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor; - - /** - * An annotation defined relational collections accessor. - * - * @author Guy Pelletier - * @since TopLink EJB 3.0 Reference Implementation - */ - public class AnnotationsCollectionAccessor extends AnnotationsRelationshipAccessor { - /** - * INTERNAL: - */ - public AnnotationsCollectionAccessor(AnnotatedAccessibleObject accessibleObject, EJBAnnotationsProcessor processor, AnnotationsDescriptor descriptor) { - super(accessibleObject, processor, descriptor); - } - - /** - * INTERNAL: - * Method to return a map key for a collection mapping. Assumes hasMapKey() - * has been called before asking for the map key name. - */ - public String getMapKey() { - if (isAnnotationPresent(MapKey.class)) { - MapKey mapKey = getAnnotation(MapKey.class); - return mapKey.name(); - } else { - return ""; - } - } - - /** - * INTERNAL: - * Return the order by value on this accessor. Assumes hasOrderBy() has been - * called before asking for the order by value. - */ - public String getOrderBy() { - OrderBy orderBy = getAnnotation(OrderBy.class); - return orderBy.value(); - } - - /** - * INTERNAL: - * Method to check if this accessor has an @OrderBy. - */ - public boolean hasOrderBy() { - return isAnnotationPresent(OrderBy.class); - } - } --- 0 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/EJBAnnotationsProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000015/AB0952363AC40CBFE034080020E8C54E.120 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/EJBAnnotationsProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000015/AB0952363AC40CBFE034080020E8C54E.120 Wed Apr 26 10:36:39 2006 *************** *** 1287,1292 **** --- 1287,1304 ---- /** * INTERNAL: + * Process a @MapKey for a 1-M or M-M mapping. Will return the map key name + * that should be used. + */ + protected String processMapKey(CollectionMapping mapping, MetadataAccessor accessor) { + MapKey mapKey = AnnotationsHelper.getAnnotation(MapKey.class, accessor); + String mapKeyName = (mapKey == null) ? "" : mapKey.name(); + + return processMapKey(mapping, mapKeyName, accessor); + } + + /** + * INTERNAL: * Process a @NamedNativeQueries. The method will also look for * a @NamedNativeQuery. This method currently only stores the queries if * there are some. The actually query processing isn't done till *************** *** 1806,1811 **** --- 1818,1839 ---- /** * INTERNAL: + * Process a @Temporal. The method may still be called if no @Temporal + * has been specified but the accessor's reference class is a valid + * temporal type. + */ + protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor accessor) { + Temporal temporal = AnnotationsHelper.getAnnotation(Temporal.class, accessor); + + if (temporal == null) { + getValidator().throwNoTemporalTypeSpecified(accessor.getJavaClass(), accessor.getAttributeName()); + } else { + processTemporal(mapping, temporal.value().name(), accessor); + } + } + + /** + * INTERNAL: * Process a @UniqueConstraint(s) for the given table. */ protected void processUniqueConstraints(Object[] constraints, DatabaseTable table) { ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/EntityMappingsXMLProcessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000016/AB0952363AC40CBFE034080020E8C54E.97 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/EntityMappingsXMLProcessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000016/AB0952363AC40CBFE034080020E8C54E.97 Wed Apr 26 10:36:54 2006 *************** *** 1856,1861 **** --- 1856,1876 ---- xmlDmd.setEntityEventListener(listener); } } + + /** + * INTERNAL: + * Process map-key for a one-to-many or many-to-many mapping. + * @return the map key method name that should be used, null otherwise + */ + protected String processMapKey(CollectionMapping mapping, MetadataAccessor metadataAccessor) { + XMLAccessor accessor = (XMLAccessor) metadataAccessor; + + if (!accessor.hasMapKey()) { + return null; + } + + return processMapKey(mapping, accessor.getMapKey(), accessor); + } /** * INTERNAL: *************** *** 2446,2451 **** --- 2461,2479 ---- } } } + + /** + * INTERNAL: + */ + protected void processTemporal(DirectToFieldMapping mapping, MetadataAccessor metadataAccessor) { + XMLAccessor accessor = (XMLAccessor) metadataAccessor; + + if (accessor.hasTemporal()) { + processTemporal(mapping, accessor.getTemporalNode().getNodeValue(), accessor); + } else { + getValidator().throwNoTemporalTypeSpecified(accessor.getJavaClass(), accessor.getAttributeName()); + } + } /** * INTERNAL: ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsRelationshipAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000017/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/annotations/accessors/AnnotationsRelationshipAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000017/AB0952363AC40CBFE034080020E8C54E.1 Wed Apr 26 10:59:05 2006 *************** *** 23,30 **** import javax.persistence.FetchType; import javax.persistence.CascadeType; - import javax.persistence.JoinColumn; - import javax.persistence.JoinColumns; import oracle.toplink.essentials.internal.ejb.cmp3.annotations.AnnotationsDescriptor; import oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor; --- 23,28 ---- *************** *** 85,106 **** /** * INTERNAL: - * Method to check if an annotated element has a @JoinColumn. - */ - public boolean hasJoinColumn() { - return isAnnotationPresent(JoinColumn.class); - } - - /** - * INTERNAL: - * Method to check if an annotated element has a @JoinColumns. - */ - public boolean hasJoinColumns() { - return isAnnotationPresent(JoinColumns.class); - } - - /** - * INTERNAL: */ protected void setCascadeTypes(CascadeType[] cascadeTypes) { m_cascadeTypes = cascadeTypes; --- 83,88 ---- ================================================================================ Merge Diffs: /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/XMLAccessor.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000018/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Wed Apr 26 13:18:54 2006 -------------------------------------------------------------------------------- *** /ade/gpelleti_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/xml/XMLAccessor.java Wed Apr 26 13:08:11 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/gpelleti/gpelleti_ri_gf578_060425/ade_storage/000018/AB0952363AC40CBFE034080020E8C54E.14 Wed Apr 26 11:47:11 2006 *************** *** 253,262 **** * INTERNAL: */ public String getMapKey() { String mapKey = ""; - Node mapKeyNode = getMapKeyNode(); ! if (mapKeyNode != null && mapKeyNode.getNodeValue() != null) { mapKey = mapKeyNode.getNodeValue(); } --- 253,262 ---- * INTERNAL: */ public String getMapKey() { + Node mapKeyNode = getMapKeyNode(); String mapKey = ""; ! if (mapKeyNode.getNodeValue() != null) { mapKey = mapKeyNode.getNodeValue(); } *************** *** 396,410 **** /** * INTERNAL: - * Return the temporal type for this accessor. Assumes there is a temporal - * node. - */ - public String getTemporalType() { - return getTemporalNode().getNodeValue(); - } - - /** - * INTERNAL: */ public boolean hasAttributeOverrides() { return getAttributeOverrideNodes() != null; --- 396,401 ---- *************** *** 460,465 **** --- 451,464 ---- NodeList joinColumnNodes = m_xPathEngine.selectNodes(m_node, new String[] {XMLConstants.JOIN_COLUMN}); return (joinColumnNodes != null && joinColumnNodes.getLength() > 1); } + + /** + * INTERNAL: + * Method to check if m_node has a map-key sub-element. + */ + public boolean hasMapKey() { + return getMapKeyNode() != null; + } /** * INTERNAL: