首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

hibernate中@Transient的运用

2012-11-09 
hibernate中@Transient的使用?? 项目中可能有许多实体的需要辅助的属性和方法辅助,hibernate中实体bean中

hibernate中@Transient的使用

?? 项目中可能有许多实体的需要辅助的属性和方法辅助,hibernate中实体bean中所有的非static非@Transient那么必须使用@Transient注解的属性都可以被持久化,除非你将其注解为@Transient。

所有没有定义注解的属性相等于@Basic。

?

?

?

?@Transient
?public BigDecimal getTotalServicePrice() {
??BigDecimal total = new BigDecimal(0);
??// 总修正费用
??total = total.add(getTotalFixPrice());
??// 总送票费用
??BigDecimal df = getDeliveryInfo().getDeliveryFare();
??if (df != null)
???total = total.add(getDeliveryInfo().getDeliveryFare());
??// 总的卖价格调整
??total = total.add(priceFix);
??return total;
?}

热点排行