Package org.springframework.data.neo4j.aspects.support.domain

Examples of org.springframework.data.neo4j.aspects.support.domain.Account2.persist()


    @Test @Transactional
    public void testDefaultFailOnDuplicateSetToTrueSavesCorrectlyWhenUpdating() {
        final String UPDATED_NAME = "Mr George - Current Account 2";
        Account2 acc1 = new Account2("111-222-333", "Mr George - Current Account 1");
        acc1.persist();
        acc1.setName(UPDATED_NAME);
        acc1.persist(); // This should save fine

        Account2 loadedAcc1 = account2Repository.findBySchemaPropertyValue("accountNumber","111-222-333");
        assertNotNull(loadedAcc1);
View Full Code Here


    public void testDefaultFailOnDuplicateSetToTrueSavesCorrectlyWhenUpdating() {
        final String UPDATED_NAME = "Mr George - Current Account 2";
        Account2 acc1 = new Account2("111-222-333", "Mr George - Current Account 1");
        acc1.persist();
        acc1.setName(UPDATED_NAME);
        acc1.persist(); // This should save fine

        Account2 loadedAcc1 = account2Repository.findBySchemaPropertyValue("accountNumber","111-222-333");
        assertNotNull(loadedAcc1);
        assertEquals("Expected name to have been updated (merged) with last value",UPDATED_NAME,loadedAcc1.getName());
    }
View Full Code Here

    @Transactional
    public void testDefaultFailOnDuplicateSetToTrueCausesExceptionWhenAnotherDuplicateEntityCreated() {
        Account2 acc1 = new Account2("111-222-333", "Mr George - Current Account 1");
        Account2 acc2 = new Account2("111-222-333", "Mr George - Current Account 2");
        acc1.persist();
        acc2.persist(); // This should cause an exception
    }

    @Test @Transactional
    public void testDefaultFailOnDuplicateSetToFalseCausesMergeWhenAnotherDuplicateEntityCreated() {
        final String UPDATED_NAME = "Mr George - Current Account 2";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.