/** * INTERNAL * @since EclipseLink 2.6.0 */ @Override public ConversionManager getConversionManager() { if(null == session) { return null; } else { return (ConversionManager) session.getDatasourcePlatform().getConversionManager(); } }
/** * INTERNAL: * Return the class loader for the session's application. * This loader should be able to load any application or EclipseLink class. */ public ClassLoader getLoader() { return getDatasourcePlatform().getConversionManager().getLoader(); }
/** * PUBLIC: * The default value to substitute for database NULLs can be configured * on a per-class basis. * Example: login.setDefaultNullValue(long.class, new Long(0)) */ public void setDefaultNullValue(Class type, Object value) { getDatasourcePlatform().getConversionManager().setDefaultNullValue(type, value); }
/** * INTERNAL: * Return the class loader for the session's application. * This loader should be able to load any application or EclipseLink class. */ public ClassLoader getLoader() { return getDatasourcePlatform().getConversionManager().getLoader(); }
/** * Returns conversion manager from session datasource platform. * * @return conversion manager */ public ConversionManager getOxmConversionManager() { return (org.eclipse.persistence.internal.oxm.ConversionManager) getSession().getDatasourcePlatform().getConversionManager(); }
/** * Returns the {@link ClassLoader} used by EclipseLink to load the application's classes. * * @return The application's {@link ClassLoader} */ private ClassLoader getClassLoader() { return getSession().getDatasourcePlatform().getConversionManager().getLoader(); }
/** * ADVANCE: * This method returns the class type that this changeSet Represents. * This requires the session to reload the class on serialization. */ @Override public Class getClassType(org.eclipse.persistence.sessions.Session session) { if (classType == null) { classType = (Class)((AbstractSession)session).getDatasourcePlatform().getConversionManager().convertObject(getClassName(), ClassConstants.CLASS); } return classType; }
/** * ADVANCE: * This method returns the class type that this changeSet Represents. * This requires the session to reload the class on serialization. */ public Class getClassType(org.eclipse.persistence.sessions.Session session) { if (classType == null) { classType = (Class)((AbstractSession)session).getDatasourcePlatform().getConversionManager().convertObject(getClassName(), ClassConstants.CLASS); } return classType; }
/** * ADVANCE: * This method returns the class type that this changeSet Represents. * This requires the session to reload the class on serialization. */ public Class getClassType(org.eclipse.persistence.sessions.Session session) { if (classType == null) { classType = (Class)((AbstractSession)session).getDatasourcePlatform().getConversionManager().convertObject(getClassName(), ClassConstants.CLASS); } return classType; }
/** * Rebuild writeLockValue to the expected type from user format i.e XML change set has all values as String. */ protected void rebuildWriteLockValueFromUserFormat(ClassDescriptor descriptor, AbstractSession session) { if (descriptor.getOptimisticLockingPolicy() instanceof TimestampLockingPolicy) { this.writeLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.writeLockValue, ClassConstants.JavaSqlTimestamp_Class); this.initialWriteLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.initialWriteLockValue, ClassConstants.JavaSqlTimestamp_Class); } else if (descriptor.getOptimisticLockingPolicy() instanceof VersionLockingPolicy) { this.writeLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.writeLockValue, ClassConstants.BIGDECIMAL); this.initialWriteLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.initialWriteLockValue, ClassConstants.BIGDECIMAL); } }
/** * Rebuild writeLockValue to the expected type from user format i.e XML change set has all values as String. */ protected void rebuildWriteLockValueFromUserFormat(ClassDescriptor descriptor, AbstractSession session) { if (descriptor.getOptimisticLockingPolicy() instanceof TimestampLockingPolicy) { this.writeLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.writeLockValue, ClassConstants.JavaSqlTimestamp_Class); this.initialWriteLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.initialWriteLockValue, ClassConstants.JavaSqlTimestamp_Class); } else if (descriptor.getOptimisticLockingPolicy() instanceof VersionLockingPolicy) { this.writeLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.writeLockValue, ClassConstants.BIGDECIMAL); this.initialWriteLockValue = session.getPlatform(descriptor.getJavaClass()).getConversionManager().convertObject(this.initialWriteLockValue, ClassConstants.BIGDECIMAL); } }
/** * This method is used to return the number of objects in a particular Identity Map * @param className the fully qualified name of the class to get number of instances of. * @exception ClassNotFoundException thrown then the IdentityMap for that class name could not be found */ public Integer getNumberOfObjectsInIdentityMap(String className) throws ClassNotFoundException { Class classToChange = (Class)getSession().getDatasourcePlatform().getConversionManager().convertObject(className, ClassConstants.CLASS); return Integer.valueOf(getSession().getIdentityMapAccessorInstance().getIdentityMap(classToChange).getSize()); }
/** * This method is used to return the number of objects in a particular Identity Map * @param className the fully qualified name of the class to get number of instances of. * @exception thrown then the IdentityMap for that class name could not be found */ public Integer getNumberOfObjectsInIdentityMap(String className) throws ClassNotFoundException { Class classToChange = (Class)getSession().getDatasourcePlatform().getConversionManager().convertObject(className, ClassConstants.CLASS); return new Integer(getSession().getIdentityMapAccessorInstance().getIdentityMap(classToChange).getSize()); }
/** * This method is used to clear the contents of a particular identity map. Users should be * aware that if any of these objects are in use when this action is completed they will lose object identity. * @param className the fully qualified name of the class for which the identity map should be cleared. * @exception ClassNotFoundException thrown then the IdenityMap for that class name could not be found */ public void initializeIdentityMap(String className) throws ClassNotFoundException { Class classToChange = (Class)getSession().getDatasourcePlatform().getConversionManager().convertObject(className, ClassConstants.CLASS); getSession().getIdentityMapAccessorInstance().initializeIdentityMap(classToChange); }
/** * This method will log the instance level locks in the Identity Map for the given class in the session. */ public void printIdentityMapLocks(String registeredClassName) { Class registeredClass = (Class)getSession().getDatasourcePlatform().getConversionManager() .convertObject(registeredClassName, ClassConstants.CLASS); getSession().getIdentityMapAccessorInstance().getIdentityMapManager().printLocks(registeredClass); }
/** * INTERNAL: * Handler for the descriptor post build event. * Convert the key and values to their appropriate type. */ public void postBuild(org.eclipse.persistence.descriptors.DescriptorEvent event) { setKey(event.getSession().getDatasourceLogin().getDatasourcePlatform().getConversionManager().convertObject(getKey(), getKeyType())); setValue(event.getSession().getDatasourceLogin().getDatasourcePlatform().getConversionManager().convertObject(getValue(), getValueType())); }
/** * This method is used to initialize the identity maps specified by className. * @param className the fully qualified classnames identifying the identity map to initialize */ public synchronized void initializeIdentityMap(String className) throws ClassNotFoundException { Class registeredClass; //get identity map, and initialize registeredClass = (Class)getSession().getDatasourcePlatform().getConversionManager() .convertObject(className, ClassConstants.CLASS); getSession().getIdentityMapAccessor().initializeIdentityMap(registeredClass); ((AbstractSession)session).log(SessionLog.INFO, SessionLog.SERVER, "jmx_mbean_runtime_services_identity_map_initialized", className); }
public void attribute(UnmarshalRecord unmarshalRecord, String namespaceURI, String localName, String value) { unmarshalRecord.removeNullCapableValue(this); XMLField xmlField = (XMLField) xmlDirectMapping.getField(); Object realValue = xmlField.convertValueBasedOnSchemaType(value, (XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(), unmarshalRecord); // Perform operations on the object based on the null policy Object convertedValue = xmlDirectMapping.getAttributeValue(realValue, unmarshalRecord.getSession(), unmarshalRecord); xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), convertedValue); }
public void initialize(AbstractSession session) throws DescriptorException { if (getField() != null) { setField(getDescriptor().buildField(getField())); } ContainerPolicy cp = getContainerPolicy(); if (cp != null && cp.getContainerClass() == null) { Class cls = session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName()); cp.setContainerClass(cls); } }
public void initialize(AbstractSession session) throws DescriptorException { if (getField() != null) { setField(getDescriptor().buildField(getField())); } ContainerPolicy cp = getContainerPolicy(); if (cp != null && cp.getContainerClass() == null) { Class cls = session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName()); cp.setContainerClass(cls); } }