/** * INTERNAL * @since EclipseLink 2.6.0 */ @Override public ConversionManager getConversionManager() { if(null == session) { return null; } else { return (ConversionManager) session.getDatasourcePlatform().getConversionManager(); } }
/** * Get default sequence */ public Sequence getDefaultSequence() { return getDatasourcePlatform().getDefaultSequence(); }
/** * Add sequence corresponding to the name */ public void addSequence(Sequence sequence) { getDatasourcePlatform().addSequence(sequence); }
/** * INTERNAL: * Convert to the field class. */ public Object convertObjectValueToDataValue(Object attributeValue, Session session) { try { return ((AbstractSession)session).getDatasourcePlatform().convertObject(attributeValue, getDataClass()); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(mapping, mapping.getDescriptor(), e); } }
/** * INTERNAL: * Build the sequence definitions. */ protected HashSet<SequenceDefinition> buildSequenceDefinitions() { // Remember the processed - to handle each sequence just once. HashSet processedSequenceNames = new HashSet(); HashSet<SequenceDefinition> sequenceDefinitions = new HashSet<SequenceDefinition>(); for (ClassDescriptor descriptor : getSession().getDescriptors().values()) { if (descriptor.usesSequenceNumbers()) { String seqName = descriptor.getSequenceNumberName(); if (seqName == null) { seqName = getSession().getDatasourcePlatform().getDefaultSequence().getName(); } if (! processedSequenceNames.contains(seqName)) { processedSequenceNames.add(seqName); Sequence sequence = getSession().getDatasourcePlatform().getSequence(seqName); SequenceDefinition sequenceDefinition = buildSequenceDefinition(sequence); if (sequenceDefinition != null) { sequenceDefinitions.add(sequenceDefinition); } } } } return sequenceDefinitions; }
DatabaseField modifyField = modifyRow.getField(field); if (modifyField != null) { if (session.getDatasourcePlatform().shouldUseCustomModifyForCall(modifyField)) { value = session.getDatasourcePlatform().getCustomModifyValueForCall(this, value, modifyField, shouldBind);
/** * Get sequence corresponding to the name */ public Sequence getSequence(String seqName) { return getDatasourcePlatform().getSequence(seqName); }
/** * Add the parameter. * If using binding bind the parameter otherwise let the platform print it. * The platform may also decide to bind the value. */ public void appendParameter(Writer writer, Object parameter, AbstractSession session) { session.getDatasourcePlatform().appendParameter(this, writer, parameter); }
/** * ADVANCED: * Set the database platform to be custom platform. */ public void usePlatform(Platform platform) { if (getDatasourcePlatform() != null) { getDatasourcePlatform().copyInto(platform); } setPlatform(platform); }
/** * INTERNAL: * Used only for writing the login into XML or Java. */ public Sequence getDefaultSequenceToWrite() { return getDatasourcePlatform().getDefaultSequenceToWrite(); }
/** * INTERNAL: * Clone the login. * This also clones the platform as it is internal to the login. */ @Override public DatasourceLogin clone() { DatasourceLogin clone = null; try { clone = (DatasourceLogin)super.clone(); } catch (Exception exception) { throw new AssertionError(exception); } if (getConnector() != null) { clone.setConnector((Connector)getConnector().clone()); } clone.setDatasourcePlatform((Platform)getDatasourcePlatform().clone()); clone.setProperties((Properties)properties.clone()); return clone; }
Object value = modifyRow.get(field); if (value != null) { value = session.getDatasourcePlatform().getCustomModifyValueForCall(this, value, field, false);
/** * INTERNAL: * Convert to the field class. */ public Object convertObjectValueToDataValue(Object attributeValue, Session session) { try { return ((AbstractSession)session).getDatasourcePlatform().convertObject(attributeValue, getDataClass()); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(mapping, mapping.getDescriptor(), e); } }
/** * INTERNAL: * Build the sequence definitions. */ protected HashSet<SequenceDefinition> buildSequenceDefinitions() { // Remember the processed - to handle each sequence just once. HashSet processedSequenceNames = new HashSet(); HashSet<SequenceDefinition> sequenceDefinitions = new HashSet<SequenceDefinition>(); for (ClassDescriptor descriptor : getSession().getDescriptors().values()) { if (descriptor.usesSequenceNumbers()) { String seqName = descriptor.getSequenceNumberName(); if (seqName == null) { seqName = getSession().getDatasourcePlatform().getDefaultSequence().getName(); } if (! processedSequenceNames.contains(seqName)) { processedSequenceNames.add(seqName); Sequence sequence = getSession().getDatasourcePlatform().getSequence(seqName); SequenceDefinition sequenceDefinition = buildSequenceDefinition(sequence); if (sequenceDefinition != null) { sequenceDefinitions.add(sequenceDefinition); } } } } return sequenceDefinitions; }
DatabaseField modifyField = modifyRow.getField(field); if (modifyField != null) { if (session.getDatasourcePlatform().shouldUseCustomModifyForCall(modifyField)) { value = session.getDatasourcePlatform().getCustomModifyValueForCall(this, value, modifyField, shouldBind);
/** * Get sequence corresponding to the name */ public Sequence getSequence(String seqName) { return getDatasourcePlatform().getSequence(seqName); }
/** * Add the parameter. * If using binding bind the parameter otherwise let the platform print it. * The platform may also decide to bind the value. */ public void appendParameter(Writer writer, Object parameter, AbstractSession session) { session.getDatasourcePlatform().appendParameter(this, writer, parameter); }
/** * ADVANCED: * Set the database platform to be custom platform. */ public void usePlatform(Platform platform) { if (getDatasourcePlatform() != null) { getDatasourcePlatform().copyInto(platform); } setPlatform(platform); }
/** * INTERNAL: * Used only for writing the login into XML or Java. */ public Sequence getDefaultSequenceToWrite() { return getDatasourcePlatform().getDefaultSequenceToWrite(); }
/** * INTERNAL: * Clone the login. * This also clones the platform as it is internal to the login. */ public Object clone() { DatasourceLogin clone = null; try { clone = (DatasourceLogin)super.clone(); } catch (Exception exception) { // should not happen...do nothing } if (getConnector() != null) { clone.setConnector((Connector)getConnector().clone()); } clone.setDatasourcePlatform((Platform)getDatasourcePlatform().clone()); clone.setProperties((Properties)properties.clone()); return clone; }