public Class getAttributeClass() { return oxmAccessor.getAttributeClass(); }
/** * INTERNAL: * Return the class this key mapping maps or the descriptor for it * @return */ public Class getMapKeyTargetType(){ Class aClass = getAttributeAccessor().getAttributeClass(); // 294765: check the attributeClassification when the MapKey annotation is not specified if(null == aClass) { aClass = getAttributeClassification(); } return aClass; }
/** * INTERNAL: * Default to mutable if mapped as a DOM. */ public void preInitialize(AbstractSession session) throws DescriptorException { if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } if ((this.isMutable == null) && (this.attributeClassification != ClassConstants.STRING)) { setIsMutable(true); } super.preInitialize(session); }
/** * INTERNAL: * Default to mutable if mapped as a DOM. */ public void preInitialize(AbstractSession session) throws DescriptorException { if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } if ((this.isMutable == null) && (this.attributeClassification != ClassConstants.STRING)) { setIsMutable(true); } super.preInitialize(session); }
/** * INTERNAL: * Default to mutable if mapped as a DOM. */ @Override public void preInitialize(AbstractSession session) throws DescriptorException { if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } if ((this.isMutable == null) && (this.attributeClassification != ClassConstants.STRING)) { setIsMutable(true); } super.preInitialize(session); }
/** * INTERNAL: * Once descriptors are serialized to the remote session. All its mappings and reference descriptors are traversed. Usually * mappings are initialized and serialized reference descriptors are replaced with local descriptors if they already exist on the * remote session. */ @Override public void remoteInitialization(DistributedSession session) { if (!isRemotelyInitialized()) { super.remoteInitialization(session); if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } this.attributeObjectClassification = Helper.getObjectClass(this.attributeClassification); } }
/** * INTERNAL: * Once descriptors are serialized to the remote session. All its mappings and reference descriptors are traversed. Usually * mappings are initialized and serialized reference descriptors are replaced with local descriptors if they already exist on the * remote session. */ public void remoteInitialization(DistributedSession session) { if (!isRemotelyInitialized()) { super.remoteInitialization(session); if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } this.attributeObjectClassification = Helper.getObjectClass(this.attributeClassification); } }
/** * INTERNAL: * Return the class this key mapping maps or the descriptor for it * @return */ public Class getMapKeyTargetType() { Class aClass = getAttributeAccessor().getAttributeClass(); // 294765: check the attributeClassification when the MapKey annotation is not specified if (null == aClass) { aClass = getAttributeClassification(); } if (null == aClass) { aClass = getField().getType(); } return aClass; }
/** * INTERNAL: * Return the class this key mapping maps or the descriptor for it * @return */ public Class getMapKeyTargetType() { Class aClass = getAttributeAccessor().getAttributeClass(); // 294765: check the attributeClassification when the MapKey annotation is not specified if (null == aClass) { aClass = getAttributeClassification(); } if (null == aClass) { aClass = getField().getType(); } return aClass; }
/** * INTERNAL: * Once descriptors are serialized to the remote session. All its mappings and reference descriptors are traversed. Usually * mappings are initialized and serialized reference descriptors are replaced with local descriptors if they already exist on the * remote session. */ @Override public void remoteInitialization(DistributedSession session) { if (!isRemotelyInitialized()) { super.remoteInitialization(session); if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } this.attributeObjectClassification = Helper.getObjectClass(this.attributeClassification); } }
/** * INTERNAL: * Initialize the state of mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); setFields(collectFields()); this.containerPolicy.prepare(getSelectionQuery(), session); // Check that the container policy is correct for the collection type. if ((!usesIndirection()) && (!getAttributeAccessor().getAttributeClass().isAssignableFrom(this.containerPolicy.getContainerClass()))) { throw DescriptorException.incorrectCollectionPolicy(this, getAttributeAccessor().getAttributeClass(), this.containerPolicy.getContainerClass()); } if(listOrderField != null) { initializeListOrderField(session); } }
/** * INTERNAL: * Initialize the state of mapping. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); setFields(collectFields()); this.containerPolicy.prepare(getSelectionQuery(), session); // Check that the container policy is correct for the collection type. if ((!usesIndirection()) && (!getAttributeAccessor().getAttributeClass().isAssignableFrom(this.containerPolicy.getContainerClass()))) { throw DescriptorException.incorrectCollectionPolicy(this, getAttributeAccessor().getAttributeClass(), this.containerPolicy.getContainerClass()); } if(listOrderField != null) { initializeListOrderField(session); } }
/** * INTERNAL: * Initialize the state of mapping. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); setFields(collectFields()); this.containerPolicy.prepare(getSelectionQuery(), session); // Check that the container policy is correct for the collection type. if ((!usesIndirection()) && (!getAttributeAccessor().getAttributeClass().isAssignableFrom(this.containerPolicy.getContainerClass()))) { throw DescriptorException.incorrectCollectionPolicy(this, getAttributeAccessor().getAttributeClass(), this.containerPolicy.getContainerClass()); } if(listOrderField != null) { initializeListOrderField(session); } }
/** * INTERNAL: * Initialize the attribute classification. * @Throws DescriptorException when attributeClassification is null */ public void preInitialize(AbstractSession session) throws DescriptorException { super.preInitialize(session); // Allow the attribute class to be set by the user. if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } this.attributeObjectClassification = Helper.getObjectClass(this.attributeClassification); // Initialize isMutable if not specified, default is false (assumes not mutable). if (this.isMutable == null) { if (getConverter() != null) { setIsMutable(getConverter().isMutable()); } else { setIsMutable(false); } // If mapping a temporal type, use the project mutable default. if (ClassConstants.UTILDATE.isAssignableFrom(getAttributeClassification()) || ClassConstants.CALENDAR.isAssignableFrom(getAttributeClassification())) { setIsMutable(session.getProject().getDefaultTemporalMutable()); } } }
/** * INTERNAL: * Initialize the attribute classification. */ @Override public void preInitialize(AbstractSession session) throws DescriptorException { super.preInitialize(session); // Allow the attribute class to be set by the user. if (this.attributeClassification == null) { this.attributeClassification = getAttributeAccessor().getAttributeClass(); } this.attributeObjectClassification = Helper.getObjectClass(this.attributeClassification); // Initialize isMutable if not specified, default is false (assumes not mutable). if (this.isMutable == null) { if (hasConverter()) { setIsMutable(getConverter().isMutable()); } else { setIsMutable(false); } // If mapping a temporal type, use the project mutable default. if ((getAttributeClassification() != null) && (ClassConstants.UTILDATE.isAssignableFrom(getAttributeClassification()) || ClassConstants.CALENDAR.isAssignableFrom(getAttributeClassification()))) { setIsMutable(session.getProject().getDefaultTemporalMutable()); } } Map nullValues = session.getPlatform(this.descriptor.getJavaClass()).getConversionManager().getDefaultNullValues(); bypassDefaultNullValueCheck = (!this.attributeClassification.isPrimitive()) && ((nullValues == null) || (!nullValues.containsKey(this.attributeClassification))); }
this.attributeClassification = getAttributeAccessor().getAttributeClass();
/** * INTERNAL: * Initialize the state of mapping. */ public void preInitialize(AbstractSession session) throws DescriptorException { super.preInitialize(session); // If weaving was used the mapping must be configured to use the weaved get/set methods. if ((this.indirectionPolicy instanceof BasicIndirectionPolicy) && ClassConstants.PersistenceWeavedLazy_Class.isAssignableFrom(getDescriptor().getJavaClass())) { Class attributeType = getAttributeAccessor().getAttributeClass(); // Check that not already weaved or coded. if (!(ClassConstants.ValueHolderInterface_Class.isAssignableFrom(attributeType))) { boolean usesMethodAccess = getAttributeAccessor().isMethodAttributeAccessor(); String originalSetMethod = null; if (usesMethodAccess) { originalSetMethod = getSetMethodName(); } setGetMethodName(Helper.getWeavedValueHolderGetMethodName(getAttributeName())); setSetMethodName(Helper.getWeavedValueHolderSetMethodName(getAttributeName())); if (usesMethodAccess) { useWeavedIndirection(originalSetMethod); } // Must re-initialize the attribute accessor. super.preInitialize(session); } } }
/** */ private Object getType(DatabaseMapping mapping) { if (mapping == null) { return null; } Object type = null; if (mapping.isDirectCollectionMapping()){ type = ((DirectCollectionMapping)mapping).getDirectField().getType(); if (type == null){ type = BasicTypeHelperImpl.ElementPlaceHolder.class; } } else if (mapping.isForeignReferenceMapping()) { ClassDescriptor descriptor = mapping.getReferenceDescriptor(); type = descriptor == null ? null : descriptor.getJavaClass(); } else if (mapping.isAggregateMapping()) { // Return the ClassDescriptor as the type representation in case // of an embedded. This makes sure that any property or field // access of the embedded uses the correct mapping information and // not the shell of the descriptors as stored by the session. type = ((AggregateMapping)mapping).getReferenceDescriptor(); } else { type = mapping.getAttributeAccessor().getAttributeClass(); } return type; }
type = mapping.getAttributeAccessor().getAttributeClass();
private Object getType(DatabaseMapping mapping) { if (mapping == null) { return null; } Object type = null; if (mapping.isDirectCollectionMapping()){ type = ((DirectCollectionMapping)mapping).getDirectField().getType(); if (type == null){ type = Object.class; } } else if (mapping.isAggregateCollectionMapping()) { // Return the ClassDescriptor as the type representation in case // of an embedded. This makes sure that any property or field // access of the embedded uses the correct mapping information and // not the shell of the descriptors as stored by the session. type = ((AggregateCollectionMapping)mapping).getReferenceDescriptor(); } else if (mapping.isForeignReferenceMapping()) { ClassDescriptor descriptor = mapping.getReferenceDescriptor(); type = descriptor == null ? null : descriptor.getJavaClass(); } else if (mapping.isAggregateMapping()) { // Return the ClassDescriptor as the type representation in case // of an embedded. This makes sure that any property or field // access of the embedded uses the correct mapping information and // not the shell of the descriptors as stored by the session. type = ((AggregateMapping)mapping).getReferenceDescriptor(); } else { type = mapping.getAttributeAccessor().getAttributeClass(); } return type; }