codecamp

映射文件myhibernate.xml

前面介绍的实体类中的属性和数据库表的列的映射关系是通过注解来指定的,但是如果在某些情况下,实体的class文件不方便修改,但是实体属性和数据表列需要重新配置映射时,就可以使用myhibernate.xml配置文件来配置映射关系,示例如下


<?xml version="1.0" encoding="UTF-8" ?>
<mappings>
	<mapping name="demo.entity.Product" table="test_product">
		<property field="name" column="name22"  ></property>
	</mapping>


</mappings>

可以使用上面的配置信息来重新配置数据表名称 和 列名称 的映射关系


主键类
使用外部数据库连接
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }