Package org.apache.torque.test.dbobject

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


    {
        // prepare
        cleanBookstore();
        Author author = new Author();
        author.setName("Author");
        author.save();
        author.setName("nameModified"); // modify after saving

        Book book = new Book();
        author.addBook(book);
        book.setTitle("Book title");
View Full Code Here


        try
        {
            Author author = new Author();
            author.setName("name");
            author.save((Connection) null);
            fail("TorqueException expected");
        }
        catch (TorqueException e)
        {
            //expected
View Full Code Here

        cleanBookstore();

        // insert test data
        Author firstAuthor = new Author();
        firstAuthor.setName("Author 1");
        firstAuthor.save();
        Book book = new Book();
        book.setAuthor(firstAuthor);
        book.setTitle("Book 1");
        book.setIsbn("unknown");
        book.save();
View Full Code Here

        book.setIsbn("unknown");
        book.save();

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

        cleanBookstore();

        // check ignore case in selects
        Author author = new Author();
        author.setName("AuTHor");
        author.save();

        Criteria criteria = new Criteria();
        criteria.where(AuthorPeer.NAME, author.getName().toLowerCase());
        criteria.setIgnoreCase(true);
        List<Author> result = AuthorPeer.doSelect(criteria);
View Full Code Here

        // Check that case is not ignored if ignoreCase is not set
        // This is known not to work for mysql
        author = new Author();
        author.setName("author");
        author.save();

        Adapter adapter = Torque.getAdapter(Torque.getDefaultDB());
        if (adapter instanceof MysqlAdapter
                || adapter instanceof MssqlAdapter)
        {
View Full Code Here

        }

        cleanBookstore();
        author = new Author();
        author.setName("AA");
        author.save();
        author = new Author();
        author.setName("BB");
        author.save();
        author = new Author();
        author.setName("ba");
View Full Code Here

        author = new Author();
        author.setName("AA");
        author.save();
        author = new Author();
        author.setName("BB");
        author.save();
        author = new Author();
        author.setName("ba");
        author.save();
        author = new Author();
        author.setName("ab");
View Full Code Here

        author = new Author();
        author.setName("BB");
        author.save();
        author = new Author();
        author.setName("ba");
        author.save();
        author = new Author();
        author.setName("ab");
        author.save();

        // check ignoreCase in Criteria
View Full Code Here

        author = new Author();
        author.setName("ba");
        author.save();
        author = new Author();
        author.setName("ab");
        author.save();

        // check ignoreCase in Criteria
        criteria = new Criteria();
        criteria.setIgnoreCase(true);
        criteria.addAscendingOrderByColumn(AuthorPeer.NAME);
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.