@Override public int hashCode() { String name = getName(); int result = name != null ? name.hashCode() : 0; result = 31 * result + getPreallocationSize(); return result; }
/** * INTERNAL: * Used in equals. */ public static boolean equalNameAndSize(Sequence seq1, Sequence seq2) { if (seq1 == seq2) { return true; } return seq1.getName().equals(seq2.getName()) && (seq1.getPreallocationSize() == seq2.getPreallocationSize()); }
/** * INTERNAL: * Used in equals. */ public static boolean equalNameAndSize(Sequence seq1, Sequence seq2) { if (seq1 == seq2) { return true; } return seq1.getName().equals(seq2.getName()) && (seq1.getPreallocationSize() == seq2.getPreallocationSize()); }
@Override public int getSequencePreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
/** * INTERNAL: * Used in equals. */ public static boolean equalNameAndSize(Sequence seq1, Sequence seq2) { if (seq1 == seq2) { return true; } return seq1.getName().equals(seq2.getName()) && (seq1.getPreallocationSize() == seq2.getPreallocationSize()); }
public int getPreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getSequencePreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getSequencePreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getPreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getSequencePreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getPreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getSequencePreallocationSize() { return getDefaultSequence().getPreallocationSize(); }
public int getPreallocationSize() { if ((size != 0) || (getDefaultSequence() == null)) { return size; } else { return getDefaultSequence().getPreallocationSize(); } }
public int getPreallocationSize() { if ((size != 0) || (getDefaultSequence() == null)) { return size; } else { return getDefaultSequence().getPreallocationSize(); } }
public int getPreallocationSize() { if ((size != 0) || (getDefaultSequence() == null)) { return size; } else { return getDefaultSequence().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: * Return the SQL required to create the Oracle sequence object. */ public Writer buildCreationWriter(AbstractSession session, Writer writer) { try { // startWith value calculated using the initial value and increment. // The first time TopLink calls select nextval, the value equal to startWith is returned. // The first sequence value EclipseLink may assign is startWith - getIncrement() + 1. int startWith = sequence.getInitialValue() + sequence.getPreallocationSize() - 1; session.getPlatform().buildSequenceObjectCreationWriter(writer, getFullName(), sequence.getPreallocationSize(), startWith); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the SQL required to alter INCREMENT BY */ public Writer buildAlterIncrementWriter(AbstractSession session, Writer writer) { try { session.getPlatform().buildSequenceObjectAlterIncrementWriter(writer, getFullName(), sequence.getPreallocationSize()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the SQL required to alter INCREMENT BY */ public Writer buildAlterIncrementWriter(AbstractSession session, Writer writer) { try { session.getPlatform().buildSequenceObjectAlterIncrementWriter(writer, getFullName(), sequence.getPreallocationSize()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the SQL required to alter INCREMENT BY */ public Writer buildAlterIncrementWriter(AbstractSession session, Writer writer) { try { session.getPlatform().buildSequenceObjectAlterIncrementWriter(writer, getFullName(), sequence.getPreallocationSize()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }