use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PlatinumBuyer in project eclipselink by eclipse-ee4j.
the class EntityManagerJUnitTestSuite method testWeaving.
/**
* Test that all of the classes in the advanced model were weaved as expected.
*/
public void testWeaving() {
// Only test if weaving was on, test runs without weaving must set this system property.
if (JUnitTestCase.isWeavingEnabled("fieldaccess")) {
internalTestWeaving(new Employee(), true, true);
internalTestWeaving(new FormerEmployment(), true, false);
internalTestWeaving(new Address(), true, false);
internalTestWeaving(new PhoneNumber(), true, false);
internalTestWeaving(new EmploymentPeriod(), true, false);
// field-locking
internalTestWeaving(new Buyer(), false, false);
// field-locking
internalTestWeaving(new GoldBuyer(), false, false);
// field-locking
internalTestWeaving(new PlatinumBuyer(), false, false);
internalTestWeaving(new Department(), true, false);
internalTestWeaving(new Golfer(), true, false);
internalTestWeaving(new GolferPK(), true, false);
internalTestWeaving(new SmallProject(), true, false);
internalTestWeaving(new LargeProject(), true, false);
internalTestWeaving(new Man(), true, false);
internalTestWeaving(new Woman(), true, false);
// serialized
internalTestWeaving(new Vegetable(), false, false);
internalTestWeaving(new VegetablePK(), false, false);
internalTestWeaving(new WorldRank(), true, false);
internalTestWeaving(new Equipment(), true, false);
internalTestWeaving(new EquipmentCode(), true, false);
internalTestWeaving(new PartnerLink(), true, false);
}
if (((OneToOneMapping) getDatabaseSession().getDescriptor(DatabaseField.class).getMappingForAttributeName("table")).usesIndirection()) {
fail("LAZY mapping should have been reverted as class was not weaved.");
}
}
use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PlatinumBuyer in project eclipselink by eclipse-ee4j.
the class EntityManagerJUnitTestSuite method testNullDouble.
// Bug 325916
public void testNullDouble() {
EntityManager em = createEntityManager();
beginTransaction(em);
PlatinumBuyer buyer = new PlatinumBuyer();
buyer.setName("Mike");
buyer.setDescription("a buyer with no purchases.");
em.persist(buyer);
em.flush();
em.createNativeQuery("update CMP3_FA_PBUYER set PURCHASES = NULL where BUYER_ID = " + buyer.getId()).executeUpdate();
em.refresh(buyer);
rollbackTransaction(em);
}
Aggregations