Package org.apache.torque.test

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


    public void testCountHelper() throws Exception
    {
        cleanBookstore();
        Author author = new Author();
        author.setName("Name");
        author.save();
       
        author = new Author();
        author.setName("Name2");
        author.save();
       
View Full Code Here


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

        author.setName("Name2");
        author.save();
       
        author = new Author();
        author.setName("Name");
        author.save();
       
        Criteria criteria = new Criteria();
        int count = new CountHelper().count(
                criteria,
                null,
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

        {
            Author author = new Author();
            author.setName(LARGE_SELECT_AUTHOR);
            try
            {
                author.save();
            }
            catch (Exception e)
            {
                fail("Cannot create test data for LargeSelectTest.");
            }
View Full Code Here

     */
    public void testCopyObject() throws Exception
    {
    Author author = new Author();
    author.setName("Author to be copied");
    author.save();

    for (int j = 1; j <= 10; j++)
    {
      Book book = new Book();
      book.setAuthor(author);
View Full Code Here

      book.save();
    }
    assertTrue("Number of books before copy should be 10, was "
                + author.getBooks().size(), author.getBooks().size() == 10);
    Author authorCopy = author.copy();
    authorCopy.save();

    author = AuthorPeer.retrieveByPK(author.getPrimaryKey());
    assertTrue("Number of books in original object should be 10, was "
                + author.getBooks().size(), author.getBooks().size() == 10);
View Full Code Here

        {
            for (int i = 1; i <= 10; i++)
            {
                Author author = new Author();
                author.setName("Author " + i);
                author.save();

                for (int j = 1; j <= 10; j++)
                {
                    Book book = new Book();
                    book.setAuthor(author);
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.