public SequenceDefinition(Sequence sequence) { super(); this.sequence = sequence; this.name = sequence.getName(); }
public SequenceDefinition(Sequence sequence) { super(); this.sequence = sequence; this.name = sequence.getName(); }
public SequenceDefinition(Sequence sequence) { super(); this.sequence = sequence; this.name = sequence.getName(); }
public String toString() { return getClass().getSimpleName() + "(" + getName() + ")"; } }
public String toString() { return getClass().getSimpleName() + "(" + getName() + ")"; } }
@Override public int hashCode() { String name = getName(); int result = name != null ? name.hashCode() : 0; result = 31 * result + getPreallocationSize(); return result; }
/** * 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. * As always the version of the method taking seqName is provided for the benefit * of DefaultSequence. */ public boolean shouldAlwaysOverrideExistingValue() { return shouldAlwaysOverrideExistingValue(getName()); }
/** * INTERNAL: * Return the newly-generated sequencing value. * Used only in case preallocation is not used (shouldUsePreallocation()==false). * Accessor may be non-null only in case shouldUseSeparateConnection()==true. * Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; * Therefore in case shouldUseSeparateConnection()==true, implementation should handle * both cases: use a separate connection if provided (accessor != null), or get by * without it (accessor == null). * @param accessor Accessor is a separate sequencing accessor (may be null); * @param writeSession Session is a Session used for writing (either ClientSession or DatabaseSession); */ public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession) { return getGeneratedValue(accessor, writeSession, getName()); }
/** * INTERNAL: * Return the newly-generated sequencing value. * Used only in case preallocation is not used (shouldUsePreallocation()==false). * Accessor may be non-null only in case shouldUseSeparateConnection()==true. * Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; * Therefore in case shouldUseSeparateConnection()==true, implementation should handle * both cases: use a separate connection if provided (accessor != null), or get by * without it (accessor == null). * @param accessor Accessor is a separate sequencing accessor (may be null); * @param writeSession Session is a Session used for writing (either ClientSession or DatabaseSession); */ public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession) { return getGeneratedValue(accessor, writeSession, getName()); }
/** * INTERNAL: * Return the newly-generated sequencing value. * Used only in case preallocation is not used (shouldUsePreallocation()==false). * Accessor may be non-null only in case shouldUseSeparateConnection()==true. * Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; * Therefore in case shouldUseSeparateConnection()==true, implementation should handle * both cases: use a separate connection if provided (accessor != null), or get by * without it (accessor == null). * @param accessor Accessor is a separate sequencing accessor (may be null); * @param writeSession Session is a Session used for writing (either ClientSession or DatabaseSession); */ public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession) { return getGeneratedValue(accessor, writeSession, getName()); }
/** * Add sequence corresponding to the name */ public void addSequence(Sequence sequence) { if (getSequences() == null) { createSequences(); } getSequences().put(sequence.getName(), sequence); }
/** * INTERNAL: * Return a Vector of newly-generated sequencing values. * Used only in case preallocation is used (shouldUsePreallocation()==true). * Accessor may be non-null only in case shouldUseSeparateConnection()==true. * Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; * Therefore in case shouldUseSeparateConnection()==true, implementation should handle * both cases: use a separate connection if provided (accessor != null), or get by * without it (accessor == null). * @param accessor Accessor is a separate sequencing accessor (may be null); * @param writeSession Session is a Session used for writing (either ClientSession or DatabaseSession); */ public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession) { return getGeneratedVector(accessor, writeSession, getName(), getPreallocationSize()); }
/** * INTERNAL: * Return a Vector of newly-generated sequencing values. * Used only in case preallocation is used (shouldUsePreallocation()==true). * Accessor may be non-null only in case shouldUseSeparateConnection()==true. * Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; * Therefore in case shouldUseSeparateConnection()==true, implementation should handle * both cases: use a separate connection if provided (accessor != null), or get by * without it (accessor == null). * @param accessor Accessor is a separate sequencing accessor (may be null); * @param writeSession Session is a Session used for writing (either ClientSession or DatabaseSession); */ public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession) { return getGeneratedVector(accessor, writeSession, getName(), getPreallocationSize()); }
/** * INTERNAL: * Make sure that the sequence is not used by more than one platform. */ protected void verifyPlatform(Platform otherPlatform) { if (getDatasourcePlatform() != otherPlatform) { String hashCode1 = Integer.toString(System.identityHashCode(getDatasourcePlatform())); String name1 = ((DatasourcePlatform)getDatasourcePlatform()).toString() + '(' + hashCode1 + ')'; String hashCode2 = Integer.toString(System.identityHashCode(otherPlatform)); String name2 = ((DatasourcePlatform)otherPlatform).toString() + '(' + hashCode2 + ')'; throw ValidationException.sequenceCannotBeConnectedToTwoPlatforms(getName(), name1, name2); } }
/** * INTERNAL: * Make sure that the sequence is not used by more than one platform. */ protected void verifyPlatform(Platform otherPlatform) { if (getDatasourcePlatform() != otherPlatform) { String hashCode1 = Integer.toString(System.identityHashCode(getDatasourcePlatform())); String name1 = ((DatasourcePlatform)getDatasourcePlatform()).toString() + '(' + hashCode1 + ')'; String hashCode2 = Integer.toString(System.identityHashCode(otherPlatform)); String name2 = ((DatasourcePlatform)otherPlatform).toString() + '(' + hashCode2 + ')'; throw ValidationException.sequenceCannotBeConnectedToTwoPlatforms(getName(), name1, name2); } }
/** * INTERNAL: * Make sure that the sequence is not used by more than one platform. */ protected void verifyPlatform(Platform otherPlatform) { if (getDatasourcePlatform() != otherPlatform) { String hashCode1 = Integer.toString(System.identityHashCode(getDatasourcePlatform())); String name1 = ((DatasourcePlatform)getDatasourcePlatform()).toString() + '(' + hashCode1 + ')'; String hashCode2 = Integer.toString(System.identityHashCode(otherPlatform)); String name2 = ((DatasourcePlatform)otherPlatform).toString() + '(' + hashCode2 + ')'; throw ValidationException.sequenceCannotBeConnectedToTwoPlatforms(getName(), name1, name2); } }