亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? beantest.java

?? 另外一種持久性o/m軟件
?? JAVA
字號:
package org.apache.torque;/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */import java.util.List;import org.apache.torque.test.Author;import org.apache.torque.test.AuthorPeer;import org.apache.torque.test.Book;import org.apache.torque.test.BookPeer;import org.apache.torque.test.bean.AuthorBean;import org.apache.torque.test.bean.BookBean;import org.apache.torque.util.Criteria;/** * Runtime tests to make sure that the code which is supplied * in the documentation actually works ;-) * * @author <a href="mailto:fischer@seitenbau.de">Thomas Fischer</a> * @version $Id: BeanTest.java,v 1.1 2005/03/28 18:25:28 tfischer Exp $ */public class BeanTest extends BaseRuntimeTestCase{    public static final String AUTHOR_1_NAME = "Joshua Bloch";        public static final int AUTHOR_1_ID = 123;           public static final String BOOK_1_TITLE = "Effective Java";        public static final String BOOK_1_ISBN = "0-618-12902-2";        public static final int BOOK_1_ID = 456;    public static final String AUTHOR_2_NAME = "W. Stevens";               /**     * Creates a new instance.     */    public BeanTest(String name)    {        super(name);    }    public void setUp()    {        super.setUp();    }    /**     * tests the creation of beans from objects and vice versa     */    public void testCreateBeans() throws Exception    {        Author author = new Author();        author.setName(AUTHOR_1_NAME);        author.setAuthorId(AUTHOR_1_ID);                AuthorBean authorBean = author.getBean();        assertTrue("bean.getName() is " + authorBean.getName()                 + " should be " + author.getName(),                author.getName().equals(authorBean.getName()));        assertTrue("bean.getId() is " + authorBean.getAuthorId()                 + " should be " + AUTHOR_1_ID,                author.getAuthorId() == authorBean.getAuthorId());                Author authorFromBean = Author.createAuthor(authorBean);        assertTrue("author from bean has name " + authorFromBean.getName()                + " should be " + author.getName(),                author.getName().equals(authorFromBean.getName()));        assertTrue("author from bean has Id " + authorFromBean.getAuthorId()                + " should be " + author.getAuthorId(),                author.getAuthorId() == authorBean.getAuthorId());    }        /**     * 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);    }     /**     * tests whether object relations are transferred correctly,     * if there is no mutual reference between objects     * @throws Exception     */    public void testDifferentObjectRelations() throws Exception     {        // 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);    }    public void testSaves() throws Exception    {        Criteria criteria = new Criteria();        criteria.add(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);        BookPeer.doDelete(criteria);                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);                Book book = Book.createBook(bookBean);        assertTrue("isModified() should return true after creation of object "                + " from new bean",                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);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂成人在线观看| 国产色一区二区| 99视频在线精品| 国产**成人网毛片九色| 久久精品国产99国产精品| 天堂午夜影视日韩欧美一区二区| 亚洲男人天堂av网| 亚洲日本韩国一区| 一区二区国产视频| 亚洲综合激情另类小说区| 亚洲美女一区二区三区| 国产乱码精品一区二区三区忘忧草 | 国产麻豆91精品| 国产一区二区三区精品欧美日韩一区二区三区 | 成人福利视频在线| 不卡视频一二三四| 一本色道a无线码一区v| 色综合天天综合| 在线精品观看国产| 欧美一区二区三区在线电影 | 日韩精品国产欧美| 免费看欧美女人艹b| 蜜臀av亚洲一区中文字幕| 蜜桃一区二区三区四区| 美日韩一级片在线观看| 国产成人三级在线观看| 欧美精品一区二区三区很污很色的 | 精品国产乱码久久久久久久| 欧美大胆人体bbbb| 国产精品久久久久久久久晋中| 亚洲男女毛片无遮挡| 婷婷丁香久久五月婷婷| 狠狠网亚洲精品| 色香蕉成人二区免费| 日韩一区二区精品葵司在线| 久久亚洲精品国产精品紫薇| 中文字幕日韩欧美一区二区三区| 亚洲午夜精品在线| 韩国午夜理伦三级不卡影院| 成人免费av在线| 制服丝袜成人动漫| 中文字幕永久在线不卡| 青青草国产成人av片免费| 成人性生交大片免费看视频在线| 欧美三级午夜理伦三级中视频| 欧美电影精品一区二区| 一区二区三区国产精华| 欧美午夜影院一区| 久久九九全国免费| 三级成人在线视频| 91啪亚洲精品| 久久久av毛片精品| 日韩成人午夜电影| av成人动漫在线观看| 精品国产乱码久久久久久图片| 亚洲男同1069视频| 丁香激情综合五月| 精品国产自在久精品国产| 亚洲成人资源在线| 91国模大尺度私拍在线视频| 久久久久久亚洲综合影院红桃 | 免费观看一级欧美片| 色综合天天综合网国产成人综合天| 欧美不卡一二三| 亚洲va欧美va人人爽| 91免费看片在线观看| 国产午夜精品一区二区三区视频| 秋霞电影一区二区| 欧美久久久影院| 亚洲综合在线第一页| 97久久久精品综合88久久| 日本一区二区三区久久久久久久久不 | 国产精品白丝jk黑袜喷水| 欧美成人精品福利| 爽好久久久欧美精品| 欧美日韩视频在线第一区| 亚洲黄色小说网站| 色999日韩国产欧美一区二区| 日本一区二区三区高清不卡| 国产成人在线电影| 国产精品美女久久久久久久| 成人综合激情网| 国产精品毛片高清在线完整版 | 91污在线观看| 中文字幕一区二区三区四区| 99国产精品久久久久| 亚洲精品日产精品乱码不卡| 一本色道久久加勒比精品 | 一区二区久久久| 欧美性色黄大片| 舔着乳尖日韩一区| 日韩午夜激情电影| 国产精品一二二区| 亚洲人成网站精品片在线观看| 91在线免费看| 亚洲成人1区2区| 日韩美女一区二区三区四区| 国产美女精品人人做人人爽| 久久免费看少妇高潮| 成人中文字幕合集| 亚洲制服丝袜一区| 日韩欧美国产高清| 成人网男人的天堂| 亚洲成人自拍偷拍| 欧美精品一区二区三区蜜桃视频 | 色综合天天综合网天天看片| 亚洲一区中文在线| 欧美成人一区二区三区| 成人免费高清在线| 成人影视亚洲图片在线| 亚洲欧洲成人精品av97| 欧美日韩成人一区| 国产 日韩 欧美大片| 亚洲国产精品久久人人爱蜜臀 | 九九国产精品视频| 亚洲欧美一区二区三区极速播放| 欧美日韩在线播放三区四区| 精品一区二区日韩| 一区二区三区产品免费精品久久75| 欧美精品在线视频| 成人黄色小视频| 日本视频中文字幕一区二区三区| 国产日韩欧美a| 91精品国产综合久久蜜臀| 成人一区二区三区视频在线观看| 午夜不卡av在线| 国产精品久久久久国产精品日日| 91麻豆精品国产91久久久资源速度 | 欧美巨大另类极品videosbest| 国产成人精品免费在线| 五月天久久比比资源色| 自拍偷拍亚洲综合| 一区二区三区四区在线播放 | 波多野结衣在线一区| 秋霞影院一区二区| 亚洲电影在线播放| 综合欧美亚洲日本| 久久九九久久九九| 日韩美女一区二区三区四区| 欧美日韩在线观看一区二区| 91美女片黄在线观看| 成人黄色a**站在线观看| 久久99精品久久久久| 日韩精品电影一区亚洲| 亚洲福利一二三区| 亚洲欧美日韩系列| 中文字幕一区二区三区乱码在线| 久久久久一区二区三区四区| 欧美一级黄色录像| 91精品国产入口| 欧美精品色综合| 欧美高清一级片在线| 欧美日韩免费电影| 欧美午夜影院一区| 欧美日韩久久久| 51精品久久久久久久蜜臀| 欧美精选午夜久久久乱码6080| 欧亚洲嫩模精品一区三区| 在线观看一区不卡| 欧美日韩高清一区二区不卡| 欧美日韩国产高清一区二区三区| 欧洲国内综合视频| 欧美探花视频资源| 欧美日韩国产高清一区| 日韩欧美在线观看一区二区三区| 亚洲日本乱码在线观看| 最新不卡av在线| 一二三区精品福利视频| 亚洲成人精品一区二区| 麻豆成人av在线| 国产一区二区不卡在线| 成人一区二区三区视频在线观看 | 91精品欧美福利在线观看| 欧美日本在线一区| 欧美成人a∨高清免费观看| 久久久综合精品| 国产精品美女久久久久久久| 亚洲精品乱码久久久久久| 偷窥少妇高潮呻吟av久久免费| 看电影不卡的网站| 丁香一区二区三区| 欧美亚洲一区三区| 精品少妇一区二区三区在线视频 | 国产精品一区专区| aaa亚洲精品一二三区| 欧美亚洲综合另类| 精品久久人人做人人爱| 国产精品成人免费在线| 亚洲成人自拍偷拍| 粉嫩久久99精品久久久久久夜| jizzjizzjizz欧美| 日韩一区二区免费在线电影| 国产欧美一区二区三区网站| 一卡二卡三卡日韩欧美| 久久99精品国产91久久来源| 色综合色综合色综合色综合色综合| 欧美另类一区二区三区| 国产精品久久久久国产精品日日 | 免费看欧美女人艹b| aaa国产一区|