hbm

How can I map “insert='false' update='false'” on a composite-id key-property which is also used in a one-to-many FK?

不问归期 提交于 2019-11-29 02:48:45
I am working on a legacy code base with an existing DB schema. The existing code uses SQL and PL/SQL to execute queries on the DB. We have been tasked with making a small part of the project database-engine agnostic (at first, change everything eventually). We have chosen to use Hibernate 3.3.2.GA and "*.hbm.xml" mapping files (as opposed to annotations). Unfortunately, it is not feasible to change the existing schema because we cannot regress any legacy features. The problem I am encountering is when I am trying to map a uni-directional, one-to-many relationship where the FK is also part of a

Nhibernate One-to-one mapping issue with child object insert error

拜拜、爱过 提交于 2019-11-28 01:45:46
问题 i've being banging my head against the desk all day with the following Nhibernate problem. Each bank account has one (and only one) set of rates associated with it. The primary key of the bank account table, BankAccountID is also a foreign key and the primary key in the AccountRate table. public class BankAccount { public virtual int BankAccountId { get; set; } public virtual string AccountName { get; set;} public virtual AccountRate AccountRate {get;set;} } public class AccountRate { public

Hibernate 第一天笔记

回眸只為那壹抹淺笑 提交于 2019-11-27 17:28:29
Hibernate 第一天笔记 * javaEE 企业级开发分层 表现层 业务层 持久层 表现层: struts2 业务层: spring 持久层: hibernate---- 操作数据库 * hibernate 框架称为 ORM ( Object Relational Mapping )框架 流行的数据库框架 JPA Java Persistence API.JPA 通过 JDK 5.0 注解或 XML 描述对象-关系表的映射关系(只有接口规范) Hibernate 最流行 ORM 框架,通过对新 - 关系映射配置,可以完全脱离底层 SQL, 对 JPA 的一个具体实现 MyBatis 本是 apache 的一个开源项目 iBatis ,支持普通 SQL 查询,存储过程和高级映射的优秀持久层框架 Apache DBUtils 、 Spring JDBCTemplate * 官网: http://sourceforge.net/projects/hibernate/files/hibernate3 * 解压 hibernate 压缩文件 documentation :文档目录 lib : jar 包目录(依赖包) project :源码包 hibernate3.jar :框架核心 jar * log4j 记录日志的级别 fatal: 致命错误 > error :普通错误 >