本文整理匯總了Java中org.jooq.Record1.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Record1.getValue方法的具體用法?Java Record1.getValue怎麽用?Java Record1.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jooq.Record1
的用法示例。
在下文中一共展示了Record1.getValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLastId
import org.jooq.Record1; //導入方法依賴的package包/類
/**
* Returns the greatest news id.
* Can be used to get the auto incremented value after a {@link News} was inserted.
*/
private long getLastId() {
final Record1<Long> result = DSL.using(jooqConfig).
select(TABLE_CONTENT.ID).
from(TABLE_CONTENT).
orderBy(TABLE_CONTENT.ID.desc()).
limit(0, 1).
fetchOne();
return result == null ? 0 : result.getValue(TABLE_CONTENT.ID);
}
示例2: getIdForUsername
import org.jooq.Record1; //導入方法依賴的package包/類
/**
* Returns the user id for the given username.
* @param username the username to find the {@link User}.
* @return the id of the {@link User}.
*/
private long getIdForUsername(final String username) {
final Record1<Long> idRecord = DSL.using(jooqConfig).
select(TABLE.ID).
from(TABLE).
where(TABLE.USERNAME.eq(username)).
fetchOne();
if(idRecord == null) {
return 0;
}
return idRecord.getValue(TABLE.ID);
}
示例3: recordExists
import org.jooq.Record1; //導入方法依賴的package包/類
/**
* Checks if a {@link User} exists with the given value in the given field.
* @return <code>true</code> if a {@link User} exists.
*/
@Override
public boolean recordExists(final String fieldName, final Object value) {
final Record1<Integer> count = DSL.using(jooqConfig).
select(DSL.count()).
from(TABLE).
where(DSL.fieldByName(fieldName).eq(value)).
fetchOne();
return count.getValue(0, int.class) > 0;
}