[#6044] Add DSLContext.currval(Name) and nextval(Name)

This commit is contained in:
lukaseder 2017-04-07 20:51:31 +02:00
parent 71e0ff9100
commit 19dc1f1a8d
2 changed files with 30 additions and 2 deletions

View File

@ -8354,6 +8354,15 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES })
BigInteger nextval(String sequence) throws DataAccessException;
/**
* Convenience method to fetch the NEXTVAL for a sequence directly from this
* {@link DSLContext}'s underlying JDBC {@link Connection}.
*
* @throws DataAccessException if something went wrong executing the query
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES })
BigInteger nextval(Name sequence) throws DataAccessException;
/**
* Convenience method to fetch the NEXTVAL for a sequence directly from this
* {@link DSLContext}'s underlying JDBC {@link Connection}.
@ -8372,6 +8381,15 @@ public interface DSLContext extends Scope , AutoCloseable {
@Support({ CUBRID, FIREBIRD, H2, POSTGRES })
BigInteger currval(String sequence) throws DataAccessException;
/**
* Convenience method to fetch the CURRVAL for a sequence directly from this
* {@link DSLContext}'s underlying JDBC {@link Connection}.
*
* @throws DataAccessException if something went wrong executing the query
*/
@Support({ CUBRID, FIREBIRD, H2, POSTGRES })
BigInteger currval(Name sequence) throws DataAccessException;
/**
* Convenience method to fetch the CURRVAL for a sequence directly from this
* {@link DSLContext}'s underlying JDBC {@link Connection}.

View File

@ -3114,7 +3114,12 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
@Override
public BigInteger nextval(String sequence) {
return nextval(sequence(name(sequence)));
return nextval(name(sequence));
}
@Override
public BigInteger nextval(Name sequence) {
return nextval(sequence(sequence));
}
@Override
@ -3125,7 +3130,12 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
@Override
public BigInteger currval(String sequence) {
return currval(sequence(name(sequence)));
return currval(name(sequence));
}
@Override
public BigInteger currval(Name sequence) throws DataAccessException {
return currval(sequence(sequence));
}
@Override