`
xitong
  • 浏览: 6401245 次
文章分类
社区版块
存档分类
最新评论
文章列表
两个pojo,Baby 和Baby File对应数据库中表baby和babyfile.两个表有外键关联,且babyfile的外键不能为空配置了个单向一对多,级联关系为save-update/** * * @author weip * @time 2006-5-10 16:23:19 * @return Set * * @hibernate.set lazy="true" cascade="save-update" * @hibernate.collection-key column="babyId" * @hibernate.col ...
DatabaseOperation.DELETEThis operation deletes only the dataset contents from the database. This operation does not delete the entire table contents but only data that are present in the dataset.DatabaseOperation.DELETE_ALL Deletes all rows of tables present in the specified dataset. If ...
原文:http://dbunit.sourceforge.net/bestpractices.html Best Practices Use one database instance per developer Good setup don't need cleanup! Use multiple small datasets Perform setup of stale data once for entire test class or test suite Connection management strategies ...
Lucene是个开源的搜索引擎,如果你的项目的一些信息需要被搜索,但又没有合适的搜索工具,那么你应该考虑使用它.为什么我会使用这个玩意?我的前一个项目是关于网络视频的,里面牵涉到对视频作搜索(废话), 主要是对视频的描述做 ...
用例驱动方法来自UP,由jacobson提出,并成为UP中最闪亮的瑰宝和核心,用例驱动主张一切来自需求,这本身非常正确,但用例之后的分析,设计过程被一些敏捷专家所诟病,认为这个过程太过重量级,因为需求一直在变,而且随着 ...
private static Test createFullTextVideoSearchDaoImpl2LoadTest() { //1个线程0.4s+,10个线程3s+,100个线程35s+ int maxUsers = 100; long maxElapsedTime = 1500; Test testCase = new FullTextVideoSearchDaoImpl2Test("testSearch"); Test timedTest = new TimedTest(testCase, maxElapsedTime); Test loadT ...
1.1)to create a timed test that waits for the completion of the ExampleTestCase.testOneSecondResponse() method and then fails if the elapsed time exceeded 1 second Code example: long maxElapsedTime = 1000; Test testCase = new ExampleTestCase("testOneSecondResponse");Test timedTest ...
例子如下: <#function displaySize size> <#assign sizeview=""> <#if (size?string)!=""> <#assign sizeview="<1M"> <#if (size >= 1024*1024*1024)> <#assign sizeview=(size/1024/1024/1024)?string("#0")+"G"> ...
如果你在http://tv.mofile.cn/dnekcab/tologin.htm页面中有个到http://tv.mofile.cn/dnekcab/admin/Login.do的链接,那么这样写 <form action="/dnekcab/admin/Login.do" method="post" > 如果是到http://tv.mofile.cn/dnekcab/Login.do的链接,那么这样写 <form action="Login.do" method="post" > ...
a) <action name="AddMachine" class="moxtv.central.web.action.uploadmachinemanage.AddMachineAction"> <result name="success" type="chain">ListAll</result> </action> b) <action name="DeleteAdmins" class="moxtv.c ...
如果有多个值抛错如果有值且只有一个,返回一个object如果没值,返回null
某个时间和当前时间的比较 private static final long DURATION = 1000L * 60 * 30;//红颜色表达式即表示半小时,依此类推 Date time = dbvote.getTime(); if ((System.currentTimeMillis() - time.getTime()) > DURATION) { return true; } return false;引申一下,完全也可以通过一个long型参数获取一个Date型数据 public class Util { /** * * @author weip * @tim ...
一个测试,测试两个动作见*1,*2public void testVoteCheck() throws Exception { //*1 测试找不到结果,返回true mockVoteDao.getVote("192.168", 1); EasyMock.expectLastCall().andReturn(null); EasyMock.replay(mockVoteDao); boolean result = voteService.voteCheck(vote); assertTrue(result); //*2 测试找到结果但小于半小时 mockVote ...
背景:dbunit mysql如果你使用dbunit,你必须得准备数据集文件如果你的mysql中的某个列是datetime型那么你准备数据时就该注意一下比如一条记录:<vote id='1' time='20060512' ip='191' type='1' babyid='1' />插入数据库时会报错: org.dbunit.dataset.datatype.TypeCastException: Error typecasting value <20060512> to TIMESTAMP 。。。。。 java.lang.IllegalArgumentException ...
作为一个页面引擎freemarker实在是方便又强大,与webwork结合使用实在是强有时候你需要在页面上对list排序,虽然你也可以在后台代码中完成,但这个可能要看具体情况排序的样本代码如下:<#list resultMap.topViewList?sort_by("monthlyViewedCount") as tvl>.............................................</#list>monthlyViewedCount是list中对象的属性默认情况下是升序,如果你要降序排代码如下:<#list res ...
Global site tag (gtag.js) - Google Analytics