Package org.apache.torque.test.dbobject

Examples of org.apache.torque.test.dbobject.Book.save()


        book.setAuthorId(1); // does not exist

        // execute & verify
        try
        {
            book.save();
            fail("Exception expected");
        }
        catch (ConstraintViolationException e)
        {
            assertTrue(e.getCause() instanceof SQLException);
View Full Code Here


        author.save();
        Book book = new Book();
        book.setAuthor(author);
        book.setTitle("Book 1");
        book.setIsbn("unknown");
        book.save();

        author = new Author();
        author.setName("Author without book");
        author.save();
View Full Code Here

        {
            book = new Book();
            book.setAuthor(author);
            book.setTitle("Book " + bookNr);
            book.setIsbn("unknown");
            book.save();
        }

    }

    /**
 
View Full Code Here

        Book book = new Book();
        book.setAuthor(author1);
        book.setTitle("Book 1");
        book.setIsbn("unknown");
        book.save();

        Book mybook = BookManager.getInstance(book.getPrimaryKey());
        assertTrue("Author1 and the author of MyBook should point to the same cache instance", author1 == mybook.getAuthor());
    }
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.