use of org.eclipse.persistence.queries.UpdateAllQuery in project eclipselink by eclipse-ee4j.
the class UpdateAllQueryAdvancedJunitTest method testFirstNamePrefixBLADoubleSalaryForSalary.
public static void testFirstNamePrefixBLADoubleSalaryForSalary() {
ExpressionBuilder builder = new ExpressionBuilder();
Expression selectionExpression = builder.get("salary").lessThan(20000);
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class, selectionExpression);
updateQuery.addUpdate("firstName", Expression.fromLiteral("'BLA'", null).concat(builder.get("firstName")));
updateQuery.addUpdate("salary", ExpressionMath.multiply(builder.get("salary"), Integer.valueOf(2)));
updateAllQueryInternal(updateQuery);
}
use of org.eclipse.persistence.queries.UpdateAllQuery in project eclipselink by eclipse-ee4j.
the class UpdateAllQueryAdvancedJunitTest method testAssignNullToAddress.
public static void testAssignNullToAddress() {
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class);
updateQuery.addUpdate("address", null);
updateAllQueryInternal(updateQuery);
}
use of org.eclipse.persistence.queries.UpdateAllQuery in project eclipselink by eclipse-ee4j.
the class UpdateAllQueryAdvancedJunitTest method testFirstNamePrefixBLAForAll.
public static void testFirstNamePrefixBLAForAll() {
ExpressionBuilder builder = new ExpressionBuilder();
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class);
updateQuery.addUpdate("firstName", Expression.fromLiteral("'BLA'", null).concat(builder.get("firstName")));
updateAllQueryInternal(updateQuery);
}
use of org.eclipse.persistence.queries.UpdateAllQuery in project eclipselink by eclipse-ee4j.
the class UpdateAllQueryAdvancedJunitTest method testFirstNamePrefixBLADoubleSalaryForAll.
public static void testFirstNamePrefixBLADoubleSalaryForAll() {
ExpressionBuilder builder = new ExpressionBuilder();
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class);
updateQuery.addUpdate("firstName", Expression.fromLiteral("'BLA'", null).concat(builder.get("firstName")));
updateQuery.addUpdate("salary", ExpressionMath.multiply(builder.get("salary"), Integer.valueOf(2)));
updateAllQueryInternal(updateQuery);
}
use of org.eclipse.persistence.queries.UpdateAllQuery in project eclipselink by eclipse-ee4j.
the class UpdateAllQueryAdvancedJunitTest method testFirstNamePrefixBLADoubleSalaryForSalaryForFirstName.
public static void testFirstNamePrefixBLADoubleSalaryForSalaryForFirstName() {
ExpressionBuilder builder = new ExpressionBuilder();
Expression selectionExpression = builder.get("salary").lessThan(20000).and(builder.get("firstName").like("J%"));
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class, selectionExpression);
updateQuery.addUpdate("firstName", Expression.fromLiteral("'BLA'", null).concat(builder.get("firstName")));
updateQuery.addUpdate("salary", ExpressionMath.multiply(builder.get("salary"), Integer.valueOf(2)));
updateAllQueryInternal(updateQuery);
}
Aggregations