use of org.apache.cayenne.access.sqlbuilder.InsertBuilder in project cayenne by apache.
the class InsertBatchTranslator method getSql.
@Override
public String getSql() {
InsertBatchQuery query = context.getQuery();
InsertBuilder insertBuilder = SQLBuilder.insert(context.getRootDbEntity());
for (DbAttribute attribute : query.getDbAttributes()) {
// skip generated attributes, if needed
if (excludeInBatch(attribute)) {
continue;
}
insertBuilder.column(SQLBuilder.column(attribute.getName()).attribute(attribute)).value(SQLBuilder.value(1).attribute(attribute));
}
return doTranslate(insertBuilder);
}
Aggregations