/** * INTERNAL: * Indicates whether the existing pk value should always be overridden by the sequence. * As always the version of the method taking seqName is provided for the benefit * of DefaultSequence. */ public boolean shouldAlwaysOverrideExistingValue() { return shouldAlwaysOverrideExistingValue(getName()); }
/** * INTERNAL: * Indicates whether the existing pk value should always be overridden by the sequence. */ public boolean shouldAlwaysOverrideExistingValue(String seqName) { return this.shouldAlwaysOverrideExistingValue || getDefaultSequence().shouldAlwaysOverrideExistingValue(seqName); }
/** * INTERNAL: * Indicates whether the existing pk value should always be overridden by the sequence. */ public boolean shouldAlwaysOverrideExistingValue(String seqName) { return this.shouldAlwaysOverrideExistingValue || getDefaultSequence().shouldAlwaysOverrideExistingValue(seqName); }
/** * INTERNAL: * Indicates whether the existing pk value should always be overridden by the sequence. * As always the version of the method taking seqName is provided for the benefit * of DefaultSequence. */ public boolean shouldAlwaysOverrideExistingValue() { return shouldAlwaysOverrideExistingValue(getName()); }
/** * This method maintains idempotence on PUT by disallowing sequencing. * * @param descriptor descriptor of the entity passed in 'entity' parameter. * @param entity entity to process. * @return true if check is passed (no sequencing) */ private boolean checkIdempotence(ClassDescriptor descriptor, Object entity) { final AbstractDirectMapping sequenceMapping = descriptor.getObjectBuilder().getSequenceMapping(); if (sequenceMapping != null) { final Object value = sequenceMapping.getAttributeAccessor().getAttributeValueFromObject(entity); if (descriptor.getObjectBuilder().isPrimaryKeyComponentInvalid(value, descriptor.getPrimaryKeyFields().indexOf(descriptor.getSequenceNumberField())) || descriptor.getSequence().shouldAlwaysOverrideExistingValue()) { return false; } } return true; }
/** * This method maintains idempotence on PUT by disallowing sequencing. * * @param descriptor descriptor of the entity passed in 'entity' parameter. * @param entity entity to process. * @return true if check is passed (no sequencing) */ private boolean checkIdempotence(ClassDescriptor descriptor, Object entity) { final AbstractDirectMapping sequenceMapping = descriptor.getObjectBuilder().getSequenceMapping(); if (sequenceMapping != null) { final Object value = sequenceMapping.getAttributeAccessor().getAttributeValueFromObject(entity); if (descriptor.getObjectBuilder().isPrimaryKeyComponentInvalid(value, descriptor.getPrimaryKeyFields().indexOf(descriptor.getSequenceNumberField())) || descriptor.getSequence().shouldAlwaysOverrideExistingValue()) { return false; } } return true; }
if (isPrimaryKeyComponentInvalid(existingValue, index) || this.descriptor.getSequence().shouldAlwaysOverrideExistingValue()) { sequenceValue = writeSession.getSequencing().getNextValue(this.descriptor.getJavaClass()); } else {
if (isPrimaryKeyComponentInvalid(existingValue, index) || this.descriptor.getSequence().shouldAlwaysOverrideExistingValue()) { sequenceValue = writeSession.getSequencing().getNextValue(this.descriptor.getJavaClass()); } else {