Package org.apache.torque.test.dbobject

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


    {
        cleanBookstore();

        Author otherAuthor = new Author();
        otherAuthor.setName("OtherName");
        otherAuthor.save();

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


        otherAuthor.setName("OtherName");
        otherAuthor.save();

        Author author = new Author();
        author.setName("Name");
        author.save();


        // Test doUpdate methods in Peer explicitly
        Connection connection = Transaction.begin(AuthorPeer.DATABASE_NAME);
        author.setName("NewName2");
View Full Code Here

        criteria.where(AuthorPeer.AUTHOR_ID, (Long) null, Criteria.NOT_EQUAL);
        AuthorPeer.doDelete(criteria);

        Author author = new Author();
        author.setName(AUTHOR_1_NAME);
        author.save();

        assertFalse("isModified() should return false after save",
                author.isModified());
        assertFalse("isNew() should return false after save",
                author.isNew());
View Full Code Here

        author = Author.createAuthor(authorBean);
        assertTrue("isModified() should return true after creation of object "
                + "from modified bean",
                author.isModified());

        author.save();

        List<Author> authorList = AuthorPeer.doSelect(new Criteria());
        Author readAuthor = authorList.get(0);
        assertEquals("name from read Author is " + readAuthor.getName()
                +" but should be " + authorBean.getName(),
View Full Code Here

        List<Author> result = new ArrayList<Author>();
        for (int i = 1; i <= 10; i++)
        {
            Author author = new Author();
            author.setName("Author " + i);
            author.save();
            result.add(author);
            assertTrue("authorId should not be 0 after insert",
                    author.getAuthorId() != 0);

            for (int j = 1; j <= 10; j++)
View Full Code Here

        // taken from tutorial step 4 with some changes
        try
        {
            Author bloch = new Author();
            bloch.setName(AUTHOR_1_NAME);
            bloch.save();

            Author stevens = new Author();
            stevens.setName(AUTHOR_2_NAME);
            AuthorPeer.doInsert(stevens);
View Full Code Here

        List<Author> bookstoreContent = insertBookstoreData();
        Author author = new Author();
        author.setName("Author");

        // execute
        author.save();

        // verify
        assertNotNull(author.getAuthorId());
        assertEquals("Author", author.getName());
View Full Code Here

        // prepare
        cleanBookstore();
        List<Author> bookstoreContent = insertBookstoreData();
        Author author = new Author();
        author.setName("Author");
        author.save();
        author.setName("nameModified"); // modify after saving

        // execute
        author.save();
View Full Code Here

        author.setName("Author");
        author.save();
        author.setName("nameModified"); // modify after saving

        // execute
        author.save();

        // verify
        assertNotNull(author.getAuthorId());
        assertEquals("nameModified", author.getName());
        bookstoreContent.add(author);
View Full Code Here

        author.addBook(book);
        book.setTitle("Book title");
        book.setIsbn("ISBN");

        // execute
        author.save();

        // verify
        assertNotNull(author.getAuthorId());
        assertEquals("Author", author.getName());
        assertNotNull(book.getBookId());
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.