use of com.querydsl.sql.domain.Employee in project querydsl by querydsl.
the class ForeignKeyTest method on.
@Test
public void on() {
QEmployee employee = new QEmployee("employee");
QEmployee employee2 = new QEmployee("employee2");
ForeignKey<Employee> foreignKey = new ForeignKey<Employee>(employee, employee.superiorId, "ID");
assertEquals("employee.superiorId = employee2.ID", foreignKey.on(employee2).toString());
foreignKey = new ForeignKey<Employee>(employee, ImmutableList.of(employee.superiorId, employee.firstname), ImmutableList.of("ID", "FN"));
assertEquals("employee.superiorId = employee2.ID && employee.firstname = employee2.FN", foreignKey.on(employee2).toString());
}
Aggregations