当前位置: 首页>>代码示例>>Java>>正文


Java PreventionExt.setKeyval方法代码示例

本文整理汇总了Java中org.oscarehr.common.model.PreventionExt.setKeyval方法的典型用法代码示例。如果您正苦于以下问题:Java PreventionExt.setKeyval方法的具体用法?Java PreventionExt.setKeyval怎么用?Java PreventionExt.setKeyval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscarehr.common.model.PreventionExt的用法示例。


在下文中一共展示了PreventionExt.setKeyval方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPreventionWithExts

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
public void addPreventionWithExts(Prevention prevention, HashMap<String, String> exts) {
	if (prevention == null) return;

	preventionDao.persist(prevention);
	if (exts != null) {
		for (String keyval : exts.keySet()) {
			if (StringUtils.filled(keyval) && StringUtils.filled(exts.get(keyval))) {
				PreventionExt preventionExt = new PreventionExt();
				preventionExt.setPreventionId(prevention.getId());
				preventionExt.setKeyval(keyval);
				preventionExt.setVal(exts.get(keyval));
				preventionExtDao.persist(preventionExt);
			}
		}
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:17,代码来源:PreventionManager.java

示例2: addPreventionKeyValue

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
public static void addPreventionKeyValue(String preventionId, String keyval, String val) {
	try {
		PreventionExt preventionExt = new PreventionExt();
		preventionExt.setPreventionId(Integer.valueOf(preventionId));
		preventionExt.setKeyval(keyval);
		preventionExt.setVal(val);

		preventionExtDao.persist(preventionExt);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:13,代码来源:PreventionData.java

示例3: testGetPreventionExt

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
@Test 
public void testGetPreventionExt() throws Exception {
	
	int preventionId1 = 1;
	int preventionId2 = 2;
	
	String val1 = "100";
	String val2 = "200";
	
	String keyVal1 = "alpha";
	String keyVal2 = "bravo";
	
	PreventionExt prevenExt1 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt1);
	prevenExt1.setPreventionId(preventionId1);
	prevenExt1.setVal(val1);
	prevenExt1.setKeyval(keyVal1);
	dao.persist(prevenExt1);
	
	PreventionExt prevenExt2 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt2);
	prevenExt2.setPreventionId(preventionId2);
	prevenExt2.setVal(val2);
	prevenExt2.setKeyval(keyVal2);
	dao.persist(prevenExt2);
	
	HashMap<String, String> expectedResult = new HashMap<String, String>();
	expectedResult.put(keyVal1, val1);
	HashMap<String, String> result = dao.getPreventionExt(preventionId1);
	
	assertEquals(expectedResult, result);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:33,代码来源:PreventionExtDaoTest.java

示例4: addPreventionKeyValue

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
public static void addPreventionKeyValue(String preventionId, String keyval, String val) {
	try {
		PreventionExt preventionExt = new PreventionExt();
		preventionExt.setPreventionId(Integer.valueOf(preventionId));
		preventionExt.setKeyval(keyval);
		preventionExt.setVal(val);

		preventionExtDao.persist(preventionExt);
	}
	catch (Exception e) {
		log.error(e.getMessage(), e);
	}
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:14,代码来源:PreventionData.java

示例5: testFindByKeyAndValue

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
@Test
public void testFindByKeyAndValue() throws Exception {
	
	String val1 = "100";
	String val2 = "200";
	
	String keyVal1 = "alpha";
	String keyVal2 = "bravo";
	
	PreventionExt prevenExt1 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt1);
	prevenExt1.setVal(val1);
	prevenExt1.setKeyval(keyVal1);
	dao.persist(prevenExt1);
	
	PreventionExt prevenExt2 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt2);
	prevenExt2.setVal(val2);
	prevenExt2.setKeyval(keyVal2);
	dao.persist(prevenExt2);
	
	PreventionExt prevenExt3 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt3);
	prevenExt3.setVal(val1);
	prevenExt3.setKeyval(keyVal1);
	dao.persist(prevenExt3);
	
	List<PreventionExt> expectedResult = new ArrayList<PreventionExt>(Arrays.asList(prevenExt1, prevenExt3));
	List<PreventionExt> result = dao.findByKeyAndValue(keyVal1, val1);

	Logger logger = MiscUtils.getLogger();
	
	if (result.size() != expectedResult.size()) {
		logger.warn("Array sizes do not match.");
		fail("Array sizes do not match.");
	}
	for (int i = 0; i < expectedResult.size(); i++) {
		if (!expectedResult.get(i).equals(result.get(i))){
			logger.warn("Items  do not match.");
			fail("Items  do not match.");
		}
	}
	assertTrue(true);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:45,代码来源:PreventionExtDaoTest.java

示例6: testFindByPreventionIdAndKey

import org.oscarehr.common.model.PreventionExt; //导入方法依赖的package包/类
@Test
public void testFindByPreventionIdAndKey() throws Exception {
	
	int preventionId1 = 100;
	int preventionId2 = 200;
	
	String keyVal1 = "alpha";
	String keyVal2 = "bravo";
			
	PreventionExt prevenExt1 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt1);
	prevenExt1.setPreventionId(preventionId1);
	prevenExt1.setKeyval(keyVal1);
	dao.persist(prevenExt1);
	
	PreventionExt prevenExt2 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt2);
	prevenExt2.setPreventionId(preventionId2);
	prevenExt2.setKeyval(keyVal2);
	dao.persist(prevenExt2);
	
	PreventionExt prevenExt3 = new PreventionExt();
	EntityDataGenerator.generateTestDataForModelClass(prevenExt3);
	prevenExt3.setPreventionId(preventionId1);
	prevenExt3.setKeyval(keyVal1);
	dao.persist(prevenExt3);
	
	List<PreventionExt> expectedResult = new ArrayList<PreventionExt>(Arrays.asList(prevenExt1, prevenExt3));
	List<PreventionExt> result = dao.findByPreventionIdAndKey(preventionId1, keyVal1);

	Logger logger = MiscUtils.getLogger();
	
	if (result.size() != expectedResult.size()) {
		logger.warn("Array sizes do not match.");
		fail("Array sizes do not match.");
	}
	for (int i = 0; i < expectedResult.size(); i++) {
		if (!expectedResult.get(i).equals(result.get(i))){
			logger.warn("Items  do not match.");
			fail("Items  do not match.");
		}
	}
	assertTrue(true);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:45,代码来源:PreventionExtDaoTest.java


注:本文中的org.oscarehr.common.model.PreventionExt.setKeyval方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。