codecamp

ORM映射API管理查看

实体模型Bean与数据库表的ORM映射关系是在第一次操作该实体时生成的,一个实体的ORM映射关系存储为一个

org.myhibernate.core.Mapping ,全部的实体映射关系存储在 org.myhibernate.core.Mappings里面,如下示例可以查看字段的映射关系

Mapping productMapping=Mappings.getMapping(Product.class);
System.out.println("属性名和数据表列映射:"+productMapping.getPropertyColMap());
System.out.println("get方法映射:"+productMapping.getMethod_get_map());
System.out.println("set方法映射:"+productMapping.getMethod_set_map());

输出如下

属性名和数据表列映射:{id=ID, price=PRICE, madeIn=MADEIN, name=NAME}
get方法映射:{id=getId, price=getPrice, madeIn=getMadeIn, name=getName}
set方法映射:{id=setId, price=setPrice, madeIn=setMadeIn, name=setName}


缓存及其EHCache集成
注解方式指定数据源
温馨提示
下载编程狮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; }