/** * PUBLIC: */ public String getSequenceTableName() { return getTableSequence().getTableName(); }
public String getQualifiedTableName() { return getQualified(getTableName()); }
public boolean equals(Object obj) { if (obj instanceof TableSequence) { TableSequence other = (TableSequence)obj; if (equalNameAndSize(this, other)) { return getTableName().equals(other.getTableName()) && getCounterFieldName().equals(other.getCounterFieldName()) && getNameFieldName().equals(other.getNameFieldName()); } else { return false; } } else { return false; } }
@Override public int hashCode() { int result = super.hashCode(); String tableName = getTableName(); String counterFieldName = getCounterFieldName(); String nameFieldName = getNameFieldName(); result = 31 * result + (tableName != null ? tableName.hashCode() : 0); result = 31 * result + (counterFieldName != null ? counterFieldName.hashCode() : 0); result = 31 * result + (nameFieldName != null ? nameFieldName.hashCode() : 0); return result; }
public boolean equals(Object obj) { if (obj instanceof TableSequence) { TableSequence other = (TableSequence)obj; if (equalNameAndSize(this, other)) { return getTableName().equals(other.getTableName()) && getCounterFieldName().equals(other.getCounterFieldName()) && getNameFieldName().equals(other.getNameFieldName()); } else { return false; } } else { return false; } }
public boolean equals(Object obj) { if (obj instanceof TableSequence) { TableSequence other = (TableSequence)obj; if (equalNameAndSize(this, other)) { return getTableName().equals(other.getTableName()) && getCounterFieldName().equals(other.getCounterFieldName()) && getNameFieldName().equals(other.getNameFieldName()); } else { return false; } } else { return false; } }
protected String getSequenceTableName(org.eclipse.persistence.sessions.Session session) { String sequenceTableName = null; if (session.getProject().usesSequencing()) { org.eclipse.persistence.sequencing.Sequence sequence = session.getLogin().getDefaultSequence(); if (sequence instanceof org.eclipse.persistence.sequencing.TableSequence) { sequenceTableName = ((org.eclipse.persistence.sequencing.TableSequence)sequence).getTableName(); } } return sequenceTableName; } }
public String getSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { String tableName = ((TableSequence)getDefaultSequence()).getTableName(); if(tableName.length() == 0) { tableName = this.getDefaultSequenceTableName(); } return tableName; } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
public String getSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { String tableName = ((TableSequence)getDefaultSequence()).getTableName(); if(tableName.length() == 0) { tableName = this.getDefaultSequenceTableName(); } return tableName; } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
public void setSequenceTableName(String name) { if (getDefaultSequence() instanceof TableSequence) { ((TableSequence)getDefaultSequence()).setTableName(name); } else { if (!name.equals((new TableSequence()).getTableName())) { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setTableName"); } } }
public void setSequenceTableName(String name) { if (getDefaultSequence() instanceof TableSequence) { ((TableSequence)getDefaultSequence()).setTableName(name); } else { if (!name.equals((new TableSequence()).getTableName())) { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setTableName"); } } }
public String getSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { return ((TableSequence)getDefaultSequence()).getTableName(); } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
public void setSequenceTableName(String name) { if (getDefaultSequence() instanceof TableSequence) { ((TableSequence)getDefaultSequence()).setTableName(name); } else { if (!name.equals((new TableSequence()).getTableName())) { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setTableName"); } } }
public String getQualifiedSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { return getQualifiedName(((TableSequence)getDefaultSequence()).getTableName()); } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
public String getQualifiedSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { return getQualifiedName(((TableSequence)getDefaultSequence()).getTableName()); } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
public String getQualifiedSequenceTableName() { if (getDefaultSequence() instanceof TableSequence) { return getQualifiedName(((TableSequence)getDefaultSequence()).getTableName()); } else { throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); } }
protected String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetDefault) { String prefix; if (isSetDefault) { prefix = "login.setDefaultSequence(new "; } else { prefix = "login.addSequence(new "; } String str; if (sequence instanceof TableSequence) { TableSequence ts = (TableSequence)sequence; str = "TableSequence(\"" + ts.getName() + "\", " + ts.getPreallocationSize() + ", \"" + ts.getTableName() + "\", \"" + ts.getNameFieldName() + "\", \"" + ts.getCounterFieldName() + "\"));"; } else if (sequence instanceof UnaryTableSequence) { UnaryTableSequence uts = (UnaryTableSequence)sequence; str = "UnaryTableSequence(\"" + uts.getName() + "\", " + uts.getPreallocationSize() + ", \"" + uts.getCounterFieldName() + "\"));"; } else { String typeName = Helper.getShortClassName(sequence); str = typeName + "(\"" + sequence.getName() + "\", " + sequence.getPreallocationSize() + "));"; } return prefix + str; }
protected String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetDefault) { String prefix; if (isSetDefault) { prefix = "login.setDefaultSequence(new "; } else { prefix = "login.addSequence(new "; } String str; if (sequence instanceof TableSequence) { TableSequence ts = (TableSequence)sequence; str = "TableSequence(\"" + ts.getName() + "\", " + ts.getPreallocationSize() + ", \"" + ts.getTableName() + "\", \"" + ts.getNameFieldName() + "\", \"" + ts.getCounterFieldName() + "\"));"; } else if (sequence instanceof UnaryTableSequence) { UnaryTableSequence uts = (UnaryTableSequence)sequence; str = "UnaryTableSequence(\"" + uts.getName() + "\", " + uts.getPreallocationSize() + ", \"" + uts.getCounterFieldName() + "\"));"; } else { String typeName = Helper.getShortClassName(sequence); str = typeName + "(\"" + sequence.getName() + "\", " + sequence.getPreallocationSize() + "));"; } return prefix + str; }
protected String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetDefault) { String prefix; if (isSetDefault) { prefix = "login.setDefaultSequence(new "; } else { prefix = "login.addSequence(new "; } String str; if (sequence instanceof TableSequence) { TableSequence ts = (TableSequence)sequence; str = "TableSequence(\"" + ts.getName() + "\", " + ts.getPreallocationSize() + ", \"" + ts.getTableName() + "\", \"" + ts.getNameFieldName() + "\", \"" + ts.getCounterFieldName() + "\"));"; } else if (sequence instanceof UnaryTableSequence) { UnaryTableSequence uts = (UnaryTableSequence)sequence; str = "UnaryTableSequence(\"" + uts.getName() + "\", " + uts.getPreallocationSize() + ", \"" + uts.getCounterFieldName() + "\"));"; } else { String typeName = Helper.getShortClassName(sequence); str = typeName + "(\"" + sequence.getName() + "\", " + sequence.getPreallocationSize() + "));"; } return prefix + str; }
definition.addArgument("SEQ_NAME", String.class, 100); definition.addArgument("PREALLOC_SIZE", java.math.BigDecimal.class, 10); definition.addStatement("UPDATE " + ((TableSequence)login.getDefaultSequence()).getTableName() + " SET " + ((TableSequence)login.getDefaultSequence()).getCounterFieldName() + " = " + ((TableSequence)login.getDefaultSequence()).getCounterFieldName() + " + " + getSession().getPlatform().getStoredProcedureParameterPrefix() + "SEQ_NAME"); definition.addStatement("SELECT " + ((TableSequence)login.getDefaultSequence()).getCounterFieldName() + " FROM " + ((TableSequence)login.getDefaultSequence()).getTableName() + " WHERE " + ((TableSequence)login.getDefaultSequence()).getNameFieldName() + " = " + getSession().getPlatform().getStoredProcedureParameterPrefix() + "SEQ_NAME");