Examples of Author

  • org.apache.any23.plugin.Author
    Reference test class for {@link SpeciesExtractor}. @author Davide Palmisano (dpalmisano@gmail.com)
  • org.apache.aries.samples.blog.api.persistence.Author
  • org.apache.bval.jsr303.example.Author
  • org.apache.camel.dataformat.bindy.model.simple.onetomany.Author
  • org.apache.geronimo.test.jpa.entity.Author
    This class represents a blog post Author
  • org.apache.ibatis.domain.blog.Author
  • org.apache.jackrabbit.ocm.testmodel.version.Author
  • org.apache.torque.test.Author
  • org.apache.torque.test.dbobject.Author
    Author table The skeleton for this class was autogenerated by Torque on: [Wed Feb 27 08:39:08 CET 2013] You should add additional methods to this class to meet the application requirements. This class will only be generated as long as it does not already exist in the output directory.
  • org.apache.wink.jaxrs.test.jaxb.book.Author
  • org.apache.ws.jaxme.test.misc.types.Author
  • org.asciidoctor.ast.Author
  • org.bar.foo.entities.Author
  • org.conserve.objects.Author
    @author Erik Berglund
  • org.dozer.vo.cumulative.Author
    @author Dmitry Buzdin
  • org.hibernate.search.test.performance.model.Author
    @author Tomas Hradec
  • org.jooq.example.db.h2.tables.Author
  • org.jooq.example.db.h2.tables.pojos.Author
  • org.jrest.dao.test.entities.Author
    作者、编著者、编译者 @author Franky
  • org.lexev.bestwisethoughts.client.data.Author
    Represent Author instance of thought @author Alexey Evseev
  • org.objectweb.speedo.pobjects.fetchgroup.Author
    @author Y.Bersihand
  • org.objectweb.speedo.tutorial.pobjects.additional.detach.Author
    @author Y.Bersihand
  • org.ops4j.pax.exam.sample1.model.Author
  • org.ops4j.pax.exam.sample4.model.Author
  • org.ops4j.pax.exam.sample6.model.Author
  • org.purl.sword.atom.Author
    Represents an Author type, as used in ATOM. This class is used as the base class for the different areas of ATOM that represent information about people. This includes the atom:author and atom:contributor elements. @author Neil Taylor
  • org.springframework.data.elasticsearch.entities.Author
    @author Rizwan Idrees @author Mohsin Husen
  • org.wicketstuff.osgi.test.library.model.Author
  • ru.aristar.jnuget.Author
    @author Unlocker
  • timforce.Author

  • Examples of org.apache.torque.test.Author

         * tests whether object relations are transferred correctly,
         * if two objects refer to each other
         */
        public void testSameObjectRelations() throws Exception
        {
            Author author = new Author();
            author.setAuthorId(AUTHOR_1_ID);

            Book book = new Book();
            book.setBookId(BOOK_1_ID);

            author.addBook(book);
            book.setAuthor(author);

            // check one roundtrip from author
            assertTrue("author from book should be the same object as author",
                    author == book.getAuthor());

            AuthorBean authorBean = author.getBean();
            BookBean bookBean = (BookBean) authorBean.getBookBeans().get(0);
            assertTrue("authorBean from BookBean should be the same "
                    + "object as authorBean",
                    bookBean.getAuthorBean() == authorBean);

            author = Author.createAuthor(authorBean);
            book = (Book) author.getBooks().get(0);

            assertTrue("author from book should be the same object as author "
                    + "after creating from bean",
                    author == book.getAuthor());

            // check one roundtrip from book
            assertTrue("book from author should be the same object as book",
                    book == author.getBooks().get(0));

            bookBean = book.getBean();
            authorBean = bookBean.getAuthorBean();
            assertTrue("bookBean from authorBean should be the same "
                    + "object as bookBean",
                    authorBean.getBookBeans().get(0) == bookBean);

            book = Book.createBook(bookBean);
            author = book.getAuthor();

            assertTrue("book from author should be the same object as book "
                    + "after creating from bean",
                    author.getBooks().get(0) == book);
        }
    View Full Code Here

    Examples of org.apache.torque.test.Author

            // create a relation chain:
            //
            //      getBooks()  getAuthor()          getBooks()
            //         |            |                    |
            // author ----> book -----> differentAuthor ---> differentBook
            Author author = new Author();
            author.setAuthorId(AUTHOR_1_ID);

            Book book = new Book();
            book.setBookId(BOOK_1_ID);

            Author differentAuthor = new Author();
            author.setAuthorId(AUTHOR_1_ID);

            author.addBook(book);
            book.setAuthor(differentAuthor);

            Book differentBook = new Book();
            book.setBookId(BOOK_1_ID);

            differentAuthor.addBook(differentBook);

            // check one roundtrip from author
            assertTrue("author from book should not be the same object as author",
                    author != book.getAuthor());

            AuthorBean authorBean = author.getBean();
            BookBean bookBean = (BookBean) authorBean.getBookBeans().get(0);
            assertTrue("authorBean from BookBean should not be the same "
                    + "object as authorBean",
                    bookBean.getAuthorBean() != authorBean);

            author = Author.createAuthor(authorBean);
            book = (Book) author.getBooks().get(0);

            assertTrue("author from book should not be the same object as author "
                    + "after creating from bean",
                    author != book.getAuthor());

            // check one roundtrip from book
            assertTrue("book from differentAuthor should not be "
                    + "the same object as book",
                    book != differentAuthor.getBooks().get(0));

            bookBean = book.getBean();
            AuthorBean differentAuthorBean = bookBean.getAuthorBean();
            assertTrue("bookBean from differentAuthorBean should not be the same "
                    + "object as bookBean",
                    differentAuthorBean.getBookBeans().get(0) != bookBean);

            book = Book.createBook(bookBean);
            differentAuthor = book.getAuthor();

            assertTrue("book from differentAuthor should not be "
                    + "the same object as book "
                    + "after creating from bean",
                    differentAuthor.getBooks().get(0) != book);
        }
    View Full Code Here

    Examples of org.apache.torque.test.Author

            criteria = new Criteria();
            criteria.add(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());

            AuthorBean authorBean = author.getBean();

            assertFalse("bean.isModified() should return false after save "
                    + "and bean creation",
                    authorBean.isModified());
            assertFalse("bean.isNew() should return false after save "
                    + "and bean creation",
                    authorBean.isNew());

            author = Author.createAuthor(authorBean);

            assertFalse("isModified() should return false after save "
                    + "and bean roundtrip",
                    author.isModified());
            assertFalse("isNew() should return false after save "
                    + "and bean rounddtrip",
                    author.isNew());

            authorBean.setName(AUTHOR_2_NAME);
            assertTrue("bean.isModified() should return true after it was modified",
                    authorBean.isModified());
            assertFalse("bean.isNew() should still return false "
                    + "after bean creation and modification",
                    authorBean.isNew());

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

            author.save();

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

            BookBean bookBean = new BookBean();
            bookBean.setTitle(BOOK_1_TITLE);
            bookBean.setIsbn(BOOK_1_ISBN);
    View Full Code Here

    Examples of org.apache.torque.test.Author

            tearDown();

            // Create some test data
            for (int i = 0; i < TEST_ROWS; i++)
            {
                Author author = new Author();
                author.setName(LARGE_SELECT_AUTHOR);
                try
                {
                    author.save();
                }
                catch (Exception e)
                {
                    fail("Cannot create test data for LargeSelectTest.");
                }
                if (-1 == firstAuthorId)
                {
                    firstAuthorId = author.getAuthorId();
                }
            }
            // Set up the standard criteria for the test.
            criteria = new Criteria();
            criteria.add(AuthorPeer.NAME, LARGE_SELECT_AUTHOR);
    View Full Code Here

    Examples of org.apache.torque.test.Author

        /**
         * does some inserts.
         */
        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);
                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();
            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);

            assertTrue("Number of books after copy should be 10, was "
                    + authorCopy.getBooks().size(),
                    authorCopy.getBooks().size() == 10);
        }
    View Full Code Here

    Examples of org.apache.torque.test.Author

            // insert some data into the database
            // 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);

                Author withoutBook = new Author();
                withoutBook.setName(AUTHOR_3_NAME);
                AuthorPeer.doInsert(withoutBook);

                Book effective = new Book();
                effective.setTitle(BOOK_1_TITLE);
                effective.setIsbn(BOOK_1_ISBN);
    View Full Code Here

    Examples of org.apache.torque.test.Author

                        Criteria.INNER_JOIN);

                bookAuthors = AuthorPeer.doSelect(criteria);

                // from Details section
                Author author = (Author) bookAuthors.get(0);
                List books = author.getBooks();
            }
            catch (Exception e)
            {
                e.printStackTrace();
                fail("inner join : Exception caught : "
    View Full Code Here

    Examples of org.apache.torque.test.Author

            assertTrue(
                "size of bookAuthors is not 2, but"
                + bookAuthors.size(),
                bookAuthors.size() == 2);

            Author author = (Author) bookAuthors.get(0);
            assertTrue(
                "Author of first book is not"
                + AUTHOR_1_NAME
                + " but "
                + author.getName(),
                AUTHOR_1_NAME.equals(author.getName()));

            author = (Author) bookAuthors.get(1);
            assertTrue(
                "Author of second book is not"
                + AUTHOR_2_NAME
                + " but "
                + author.getName(),
                AUTHOR_2_NAME.equals(author.getName()));
        }
    View Full Code Here

    Examples of org.apache.torque.test.Author

            tearDown();

            // Create some test data
            for (int i = 0; i < TEST_ROWS; i++)
            {
                Author author = new Author();
                author.setName(LARGE_SELECT_AUTHOR);
                try
                {
                    author.save();
                }
                catch (Exception e)
                {
                    fail("Cannot create test data for LargeSelectTest.");
                }
                if (-1 == firstAuthorId)
                {
                    firstAuthorId = author.getAuthorId();
                }
            }
            // Set up the standard criteria for the test.
            criteria = new Criteria();
            criteria.add(AuthorPeer.NAME, LARGE_SELECT_AUTHOR);
    View Full Code Here

    Examples of org.apache.torque.test.Author

        /**
         * does some inserts.
         */
        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);
          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();
        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);

        assertTrue("Number of books after copy should be 10, was "
                    + author.getBooks().size(), authorCopy.getBooks().size() == 10);
        }
    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.