use of com.querydsl.example.sql.model.TweetUser in project querydsl by querydsl.
the class TweetRepository method save.
@Transactional
public Long save(Tweet tweet, Long... mentions) {
Long tweetId = save(tweet);
SQLInsertClause insert = insert(tweetUser);
for (Long mentionsId : mentions) {
TweetUser tu = new TweetUser();
tu.setTweetId(tweetId);
tu.setMentionsId(mentionsId);
insert.populate(tu).addBatch();
}
insert.execute();
return tweetId;
}
Aggregations