@Override public void run() { entity.getToManyTargetEntityList(); } };
@Override public void run() { entity.getToManyTargetEntityList(); } });
public void testGetToManyTwice() { prepareToMany(1, 3); ToManyEntity testEntity = toManyEntityDao.load(1L); List<ToManyTargetEntity> resolvedToMany1 = testEntity.getToManyTargetEntityList(); List<ToManyTargetEntity> resolvedToMany2 = testEntity.getToManyTargetEntityList(); assertSame(resolvedToMany1, resolvedToMany2); }
public void testResetToMany() { ToManyTargetEntity[] targetEntities = prepareToMany(1, 3); ToManyEntity testEntity = toManyEntityDao.load(1L); List<ToManyTargetEntity> resolvedToMany1 = testEntity.getToManyTargetEntityList(); testEntity.resetToManyTargetEntityList(); List<ToManyTargetEntity> resolvedToMany2 = testEntity.getToManyTargetEntityList(); assertNotSame(resolvedToMany1, resolvedToMany2); assertSameEntities(targetEntities, resolvedToMany2); }
public void testToManyOrder() { prepareToMany(1, 3); ToManyEntity testEntity = toManyEntityDao.load(1L); List<ToManyTargetEntity> resolvedToManyAsc = testEntity.getToManyTargetEntityList(); List<ToManyTargetEntity> resolvedToManyDesc = testEntity.getToManyDescList(); assertNotSame(resolvedToManyAsc, resolvedToManyDesc); assertEquals(resolvedToManyAsc.get(0).getId(), resolvedToManyDesc.get(2).getId()); assertSame(resolvedToManyAsc.get(0), resolvedToManyDesc.get(2)); assertSame(resolvedToManyAsc.get(1), resolvedToManyDesc.get(1)); assertSame(resolvedToManyAsc.get(2), resolvedToManyDesc.get(0)); }
public void runTestToManyBasics(long id, int count) { ToManyTargetEntity[] targetEntities = prepareToMany(id, count); ToManyEntity testEntity = toManyEntityDao.load(id); List<ToManyTargetEntity> resolvedToMany = testEntity.getToManyTargetEntityList(); assertSameEntities(targetEntities, resolvedToMany); }
public void testChangeResetToMany() { prepareToMany(1, 3); ToManyEntity testEntity = toManyEntityDao.load(1L); List<ToManyTargetEntity> resolvedToMany1 = testEntity.getToManyTargetEntityList(); testEntity.resetToManyTargetEntityList(); ToManyTargetEntity newEntity = new ToManyTargetEntity(); newEntity.setToManyId(1L); daoSession.insert(newEntity); List<ToManyTargetEntity> resolvedToMany2 = testEntity.getToManyTargetEntityList(); assertNotSame(resolvedToMany1, resolvedToMany2); assertEquals(resolvedToMany1.size() + 1, resolvedToMany2.size()); testEntity.resetToManyTargetEntityList(); toManyTargetEntityDao.deleteAll(); List<ToManyTargetEntity> resolvedToMany3 = testEntity.getToManyTargetEntityList(); assertEquals(0, resolvedToMany3.size()); }