public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession, String seqName, int size) { if (shouldUsePreallocation()) { Number value = updateAndSelectSequence(accessor, writeSession, seqName, size); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } if(writeSession.getPlatform().getDefaultSeqenceAtNextValue()) { return createVectorAtNextVal(value, seqName, size); } return createVector(value, seqName, size); } else { return null; } }
public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession, String seqName, int size) { if (shouldUsePreallocation()) { Number value = updateAndSelectSequence(accessor, writeSession, seqName, size); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } return createVector(value, seqName, size); } else { return null; } }
public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) { if (shouldUsePreallocation()) { return null; } else { Number value = updateAndSelectSequence(accessor, writeSession, seqName, 1); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } return value; } }
public boolean equals(Object obj) { if (obj instanceof QuerySequence && super.equals(obj)) { QuerySequence other = (QuerySequence)obj; return (getSelectQuery() == other.getSelectQuery()) && (getUpdateQuery() == other.getUpdateQuery()) && (shouldAcquireValueAfterInsert() == other.shouldAcquireValueAfterInsert()) && (shouldUseTransaction() == other.shouldUseTransaction()) && (shouldSkipUpdate() == other.shouldSkipUpdate()) && (shouldSelectBeforeUpdate() == other.shouldSelectBeforeUpdate()); } else { return false; } }
/** * INTERNAL: */ public void onDisconnect() { if (wasSelectQueryCreated) { setSelectQuery(null); wasSelectQueryCreated = false; } if (wasUpdateQueryCreated) { setUpdateQuery(null); wasUpdateQueryCreated = false; } super.onDisconnect(); }
/** * INTERNAL: */ public void onConnect() { super.onConnect(); if (getSelectQuery() == null) { setSelectQuery(buildSelectQuery()); wasSelectQueryCreated = getSelectQuery() != null; } if ((getUpdateQuery() == null) && !shouldSkipUpdate()) { setUpdateQuery(buildUpdateQuery()); wasUpdateQueryCreated = getUpdateQuery() != null; } }
@Override public int hashCode() { int result = super.hashCode(); ValueReadQuery selectQuery = getSelectQuery(); DataModifyQuery updateQuery = getUpdateQuery(); result = 31 * result + (selectQuery != null ? selectQuery.hashCode() : 0); result = 31 * result + (updateQuery != null ? updateQuery.hashCode() : 0); result = 31 * result + (shouldAcquireValueAfterInsert() ? 1 : 0); result = 31 * result + (shouldUseTransaction() ? 1 : 0); result = 31 * result + (shouldSkipUpdate() ? 1 : 0); result = 31 * result + (shouldSelectBeforeUpdate() ? 1 : 0); return result; }
public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession, String seqName, int size) { if (shouldUsePreallocation()) { Number value = updateAndSelectSequence(accessor, writeSession, seqName, size); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } return createVector(value, seqName, size); } else { return null; } }
public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) { if (shouldUsePreallocation()) { return null; } else { Number value = updateAndSelectSequence(accessor, writeSession, seqName, 1); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } return value; } }
public boolean equals(Object obj) { if (obj instanceof QuerySequence && super.equals(obj)) { QuerySequence other = (QuerySequence)obj; return (getSelectQuery() == other.getSelectQuery()) && (getUpdateQuery() == other.getUpdateQuery()) && (shouldAcquireValueAfterInsert() == other.shouldAcquireValueAfterInsert()) && (shouldUseTransaction() == other.shouldUseTransaction()) && (shouldSkipUpdate() == other.shouldSkipUpdate()) && (shouldSelectBeforeUpdate() == other.shouldSelectBeforeUpdate()); } else { return false; } }
/** * INTERNAL: */ public void onDisconnect() { if (wasSelectQueryCreated) { setSelectQuery(null); wasSelectQueryCreated = false; } if (wasUpdateQueryCreated) { setUpdateQuery(null); wasUpdateQueryCreated = false; } super.onDisconnect(); }
/** * INTERNAL: */ public void onConnect() { super.onConnect(); if (getSelectQuery() == null) { setSelectQuery(buildSelectQuery()); wasSelectQueryCreated = getSelectQuery() != null; if (wasSelectQueryCreated) { getSelectQuery().setName(getName()); } } if ((getUpdateQuery() == null) && !shouldSkipUpdate()) { setUpdateQuery(buildUpdateQuery()); wasUpdateQueryCreated = getUpdateQuery() != null; if (wasUpdateQueryCreated) { getUpdateQuery().setName(getName()); } } }
public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) { if (shouldUsePreallocation()) { return null; } else { Number value = updateAndSelectSequence(accessor, writeSession, seqName, 1); if (value == null) { throw DatabaseException.errorPreallocatingSequenceNumbers(); } return value; } }
public boolean equals(Object obj) { if (obj instanceof QuerySequence && super.equals(obj)) { QuerySequence other = (QuerySequence)obj; return (getSelectQuery() == other.getSelectQuery()) && (getUpdateQuery() == other.getUpdateQuery()) && (shouldAcquireValueAfterInsert() == other.shouldAcquireValueAfterInsert()) && (shouldUseTransaction() == other.shouldUseTransaction()) && (shouldSkipUpdate() == other.shouldSkipUpdate()) && (shouldSelectBeforeUpdate() == other.shouldSelectBeforeUpdate()); } else { return false; } }
/** * INTERNAL: */ public void onDisconnect() { if (wasSelectQueryCreated) { setSelectQuery(null); wasSelectQueryCreated = false; } if (wasUpdateQueryCreated) { setUpdateQuery(null); wasUpdateQueryCreated = false; } super.onDisconnect(); }
/** * INTERNAL: */ public void onConnect() { super.onConnect(); if (getSelectQuery() == null) { setSelectQuery(buildSelectQuery()); wasSelectQueryCreated = getSelectQuery() != null; if (wasSelectQueryCreated) { getSelectQuery().setName(getName()); } } if ((getUpdateQuery() == null) && !shouldSkipUpdate()) { setUpdateQuery(buildUpdateQuery()); wasUpdateQueryCreated = getUpdateQuery() != null; if (wasUpdateQueryCreated) { getUpdateQuery().setName(getName()); } } }