Package org.apache.torque.test

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


            {
                Book book = new Book();
                book.setAuthor(author);
                book.setTitle("Book " + j + " - Author " + i);
                book.setIsbn("unknown");
                book.save();
            }
        }
        // clean booleancheck table (because insert uses fixed keys)
        Criteria criteria = new Criteria();
        criteria.add(BooleanCheckPeer.TEST_KEY, (Object) null, Criteria.NOT_EQUAL);
View Full Code Here


        Book book = new Book();
        book.setTitle("title");
        book.setAuthor(author);
        book.setIsbn("ISBN");
        book.save();

        // delete without matching data
        Criteria criteria = new Criteria();
        criteria.add(
                AuthorPeer.AUTHOR_ID,
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();
        }

        // test left join
        Criteria criteria = new Criteria();
        criteria.addJoin(AuthorPeer.AUTHOR_ID, BookPeer.AUTHOR_ID,
View Full Code Here

                book.isModified());
        assertTrue("isNew() should return true after creation of object "
                + " from new bean",
                book.isNew());
        book.setAuthor(author);
        book.save();

        List bookList = BookPeer.doSelect(new Criteria());
        assertTrue("Ther should be one book in DB but there are "
                + bookList.size(),
                bookList.size() == 1);
View Full Code Here

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

        Author secondAuthor = new Author();
        secondAuthor.setName("Author 2");
        secondAuthor.save();
        for (int bookNr = 2; bookNr <=4; bookNr++)
View Full Code Here

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

        // test simple ascending order by
        Criteria criteria = new Criteria();
        criteria.addAscendingOrderByColumn(BookPeer.TITLE);
View Full Code Here

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

        Criteria criteria = new Criteria();
        criteria.addJoin(BookPeer.TITLE, AuthorPeer.NAME);
        BookPeer.addSelectColumns(criteria);
        AuthorPeer.addSelectColumns(criteria);
View Full Code Here

        {
            Book book = new Book();
            book.setAuthor(author);
            book.setTitle("Book " + j + " - " + author.getName());
            book.setIsbn("unknown");
            book.save();
        }
        assertTrue("Number of books before copy should be 10, was "
                + author.getBooks().size(),
                author.getBooks().size() == 10);
        Author authorCopy = author.copy();
View Full Code Here

            Book effective = new Book();
            effective.setTitle(BOOK_1_TITLE);
            effective.setIsbn(BOOK_1_ISBN);
            effective.setAuthor(bloch);
            effective.save();

            Book tcpip = new Book();
            tcpip.setTitle(BOOK_2_TITLE);
            tcpip.setIsbn(BOOK_2_ISBN);
            tcpip.setAuthorId(stevens.getAuthorId());
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.