use of io.requery.test.autovalue.Phone in project requery by requery.
the class AutoValueModelTest method testInsertReference.
@Test
public void testInsertReference() {
randomPerson();
Result<Person> result = data.select(Person.class).get();
Person person = result.first();
int id = data.insert(Phone.class).value(PhoneType.PHONE_NUMBER, "5555555").value(PhoneType.NORMALIZED, false).value(PhoneType.OWNER_ID, person.getId()).get().first().get(PhoneType.ID);
assertTrue(id != 0);
Phone phone = data.select(Phone.class).get().first();
assertSame(phone.getOwnerId(), person.getId());
}