long pk;
EOSQLExpression selectExpression = _factory.expressionForEntity(null);
String columnList = VALUE_COLUMN_NAME;
String tableList = ERX_SEQUENCE_TABLE;
String whereSelector = selectExpression.sqlStringForSelector(EOQualifier.QualifierOperatorEqual, name());
String whereClause = NAME_COLUMN_NAME + " " + whereSelector + " '" + name() + "'";
String lockClause = selectExpression.lockClause();
String selectStatement = selectExpression.assembleSelectStatementWithAttributes(null, true, null, null, "SELECT ", columnList , tableList, whereClause, null, null, lockClause);
ResultSet resultSet = con.createStatement().executeQuery(selectStatement);