本文整理汇总了Java中com.mysema.query.Tuple.get方法的典型用法代码示例。如果您正苦于以下问题:Java Tuple.get方法的具体用法?Java Tuple.get怎么用?Java Tuple.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mysema.query.Tuple
的用法示例。
在下文中一共展示了Tuple.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addParticipant
import com.mysema.query.Tuple; //导入方法依赖的package包/类
private void addParticipant(@Nonnull PullRequest pullRequest, @Nonnull final Tuple tuple)
{
final String username = tuple.get(participantMapping.USERNAME);
final Boolean approved = tuple.get(participantMapping.APPROVED);
final String role = tuple.get(participantMapping.ROLE);
// We are left joining so only include the participant if it is available
if (username != null || approved != null || role != null)
{
Participant participant = new Participant(username,
approved == null ? false : approved, role);
if (pullRequest.getParticipants() == null)
{
pullRequest.setParticipants(new ArrayList<Participant>());
}
if (!pullRequest.getParticipants().contains(participant))
{
pullRequest.getParticipants().add(participant);
}
}
}
示例2: QTodo
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Test
public void sec030202_複数表を指定して結合する_左外部結合() {
/* 抽出条件を組み立てる。 */
QTodo a = new QTodo("a");
QAuthor b = new QAuthor("b");
SQLQuery query = queryDslJdbcOperations.newSqlQuery();
query.from(a).leftJoin(b)
.on(b.loginId.eq(a.postedBy), b.deletedFlg.eq(0));
/* 取出すカラムとデータの取出し方を指定してクエリを発行する。 */
List<Tuple> list = queryDslJdbcOperations.query(query, new QTuple(a.id,
a.postedBy, b.name));
/* クエリの結果を表示する。 */
for (Tuple tuple : list) {
Long valId = tuple.get(a.id);
String valPostedBy = tuple.get(a.postedBy);
String valPosterName = tuple.get(b.name);
System.out.println(MessageFormat.format(
"{0}: postedBy={1}, posterName={2}", valId, valPostedBy,
valPosterName));
}
}
示例3: createDatasetInfo
import com.mysema.query.Tuple; //导入方法依赖的package包/类
private nl.idgis.publisher.database.messages.DatasetInfo createDatasetInfo (final Tuple t, final List<StoredNotification> notifications) {
return new nl.idgis.publisher.database.messages.DatasetInfo (
t.get (dataset.identification),
t.get (dataset.name),
t.get (sourceDataset.identification),
t.get (sourceDatasetVersion.name),
t.get (category.identification),
t.get (category.name),
t.get (dataset.filterConditions),
t.get (datasetStatus.imported),
t.get (datasetStatus.sourceDatasetColumnsChanged),
t.get (lastImportJob.finishTime),
t.get (lastImportJob.finishState),
notifications,
t.get (layerCountPath),
Long.MAX_VALUE, // dummy value
t.get (sourceDatasetVersion.confidential),
t.get (sourceDatasetVersion.wmsOnly),
t.get (dataset.metadataFileIdentification),
t.get (sourceDatasetVersion.physicalName)
);
}
示例4: QAuthor
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Test
public void sec020401_カラムに対する関数適用() {
QAuthor a = new QAuthor("a");
SQLQuery query = queryDslJdbcOperations.newSqlQuery();
query.from(a);
List<Tuple> list = queryDslJdbcOperations.query(
query,
new QTuple(a.id, a.loginId, a.name, a.loginId.length(),
a.loginId.concat(a.name), StringExpressions.lpad(
a.loginId, 10, 'X')));
for (Tuple tuple : list) {
Long valId = tuple.get(a.id);
String valLoginId = tuple.get(a.loginId);
String valName = tuple.get(a.name);
Integer valLength = tuple.get(a.loginId.length());
String valConcat = tuple.get(a.loginId.concat(a.name));
String valLpad = tuple.get(StringExpressions.lpad(a.loginId, 10,
'X'));
out.println(format(
"{0}: loginId={1}, name={2}, LENGTH(loginId)={3}, CONCAT(loginId, name)={4}, LPAD(loginId, 10, X)={5}",
valId, valLoginId, valName, valLength, valConcat, valLpad));
}
}
示例5: testNamedSetExpression
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Test
public void testNamedSetExpression() {
Expression<Set<String>> expr = DatabaseUtils.namedExpression("test");
QTuple q = new QTuple(expr);
Tuple t = q.newInstance(Collections.singleton("Hello, world!"));
assertNotNull(t);
Set<String> result = t.get(expr);
assertNotNull(result);
Iterator<String> itr = result.iterator();
assertTrue(itr.hasNext());
assertEquals("Hello, world!", itr.next());
assertFalse(itr.hasNext());
}
示例6: QTodo
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Test
public void sec020501_CASE式を指定する_単純CASE式() {
/* 抽出条件を組み立てる。 */
QTodo a = new QTodo("a");
SQLQuery query = queryDslJdbcOperations.newSqlQuery();
query.from(a);
/* CASE式を組立てる。 */
Expression<String> doneDesc = a.doneFlg.when(0).then("未実施").when(1)
.then("実施済").otherwise("不定");
/* 取出すカラムとデータの取出し方を指定してクエリを発行する。 */
List<Tuple> list = queryDslJdbcOperations.query(query, new QTuple(a.id,
a.doneFlg, doneDesc));
/* クエリの結果を表示する。 */
for (Tuple tuple : list) {
Long valId = tuple.get(a.id);
Integer valDoneFlg = tuple.get(a.doneFlg);
String valDoneDesc = tuple.get(doneDesc);
out.println(format("{0}: doneFlg={1}, doneDesc(CASE)={2}", valId,
valDoneFlg, valDoneDesc));
}
}
示例7: QAuthor
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Test
public void sec0101_Tupleとして取出す() {
/* 抽出条件を組み立てる。 */
QAuthor a = new QAuthor("a");
SQLQuery query = queryDslJdbcOperations.newSqlQuery();
query.from(a);
/* 取出すカラムとデータの取出し方を指定してクエリを発行する。 */
List<Tuple> list = queryDslJdbcOperations.query(query, new QTuple(a.all()));
/* クエリの結果を表示する。 */
for (Tuple tuple : list) {
Long valId = tuple.get(a.id);
String valLoginId = tuple.get(a.loginId);
String valName = tuple.get(a.name);
LocalDateTime valUpdatedAt = tuple.get(a.updatedAt);
LocalDateTime valCreatedAt = tuple.get(a.createdAt);
Integer valLockVersion = tuple.get(a.lockVersion);
Integer valDeletedFlg = tuple.get(a.deletedFlg);
out.println(format(
"{0}: loginId={1}, name={2}, updatedAt={3}, createdAt={4}, lockVersion={5}, deletedFlg={6}", valId,
valLoginId, valName, valUpdatedAt, valCreatedAt, valLockVersion, valDeletedFlg));
}
}
示例8: insert
import com.mysema.query.Tuple; //导入方法依赖的package包/类
private CompletionStage<Ack> insert(String serviceIdentification, Tuple serviceInfo, int environmentId) {
int serviceId = serviceInfo.get(service.id);
return
insertPublishedService(serviceInfo, serviceId, environmentId).thenCompose(publishedService ->
insertPublishedServiceKeyword(serviceId).thenCompose(publishedServiceKeywords ->
insertPublishedServiceStyle(serviceIdentification, serviceId).thenCompose(publishedServiceStyles ->
insertPublishedServiceDataset(serviceIdentification, serviceId).thenApply(publishedServiceDatasets -> {
log.debug("published service has {} keywords", publishedServiceKeywords);
log.debug("published service uses {} styles", publishedServiceStyles);
log.debug("published service uses {} datasets", publishedServiceDatasets);
return new Ack();
}))));
}
示例9: getFoldFunction
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Override
public Function2<Map<Integer, Branch>, Tuple, Map<Integer, Branch>> getFoldFunction()
{
return new Function2<Map<Integer, Branch>, Tuple, Map<Integer, Branch>>()
{
@Override
public Map<Integer, Branch> apply(@Nonnull final Map<Integer, Branch> integerBranchMap, @Nonnull final Tuple tuple)
{
Integer id = tuple.get(branchMapping.ID);
Branch branch = integerBranchMap.get(id);
if (branch == null)
{
// Due to the denormalised query to limit the result we skip any records we find after we reach the limit
if (integerBranchMap.size() >= MAXIMUM_ENTITIES_PER_ISSUE_KEY)
{
return integerBranchMap;
}
branch = new Branch(tuple.get(branchMapping.ID), tuple.get(branchMapping.NAME),
tuple.get(branchMapping.REPOSITORY_ID));
integerBranchMap.put(id, branch);
}
String issueKey = tuple.get(issueMapping.ISSUE_KEY);
if (!branch.getIssueKeys().contains(issueKey))
{
branch.getIssueKeys().add(issueKey);
}
return integerBranchMap;
}
};
}
示例10: getFoldFunction
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Override
public Function2<Map<Integer, PullRequest>, Tuple, Map<Integer, PullRequest>> getFoldFunction()
{
return new Function2<Map<Integer, PullRequest>, Tuple, Map<Integer, PullRequest>>()
{
@Override
public Map<Integer, PullRequest> apply(final Map<Integer, PullRequest> pullRequestsById, final Tuple tuple)
{
final Integer pullRequestId = tuple.get(prMapping.ID);
PullRequest pullRequest = pullRequestsById.get(pullRequestId);
if (pullRequest == null)
{
// If we have reached the limit then we stop processing the PRs and return them, this is not applied in the query
// as the results are denormalised so we may see several rows for one PR
if (pullRequestsById.size() >= DAOConstants.MAXIMUM_ENTITIES_PER_ISSUE_KEY)
{
return pullRequestsById;
}
pullRequest = buildPullRequest(pullRequestId, tuple);
pullRequestsById.put(pullRequestId, pullRequest);
}
addParticipant(pullRequest, tuple);
addIssueKey(pullRequest, tuple);
return pullRequestsById;
}
};
}
示例11: addIssueKey
import com.mysema.query.Tuple; //导入方法依赖的package包/类
private void addIssueKey(@Nonnull PullRequest pullRequest, @Nonnull final Tuple tuple)
{
final String issueKey = tuple.get(issueMapping.ISSUE_KEY);
if (!pullRequest.getIssueKeys().contains(issueKey))
{
pullRequest.getIssueKeys().add(issueKey);
}
}
示例12: fromTuple
import com.mysema.query.Tuple; //导入方法依赖的package包/类
public static Info fromTuple(Tuple tuple) {
Integer id = tuple.get(QBalance.balance.id);
if (id == null)
return null;
String name = DatabaseManager.getInstance().getPlayerName(id);
Long amount = tuple.get(QBalance.balance.amount);
Info info = new Info();
info.setName(name);
info.setAmount(amount == null ? 0 : amount);
return info;
}
示例13: map
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Override
protected SchemaVersion map(Tuple tuple) {
if (tuple == null) {
return null;
}
return new SchemaVersion(
tuple.get(QFlywaySchema.flywaySchema.script),
tuple.get(QFlywaySchema.flywaySchema.installedOn)
);
}
示例14: tupleToDatasetDescription
import com.mysema.query.Tuple; //导入方法依赖的package包/类
private ResourceDescription tupleToDatasetDescription(Tuple tuple, Expression<String> identificationExpression, boolean published) {
Timestamp createTime = tuple.get(sourceDatasetVersion.revision);
boolean confidential = tuple.get(sourceDatasetVersion.metadataConfidential);
return new DefaultResourceDescription(
getName(tuple.get(identificationExpression)),
new DefaultResourceProperties(
false,
createTime,
resourceProperties(confidential, published)));
}
示例15: map
import com.mysema.query.Tuple; //导入方法依赖的package包/类
@Override
protected SupportVote map(Tuple tuple) {
SupportVote vote = new SupportVote(
tuple.get(qSupportVote.initiativeId),
tuple.get(qSupportVote.supportid),
tuple.get(qSupportVote.details),
tuple.get(qSupportVote.created)
);
vote.setVerificationBatch(tuple.get(qSupportVote.batchId));
return vote;
}