`
zhang_yingjie
  • 浏览: 111761 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

inheritance mapping

    博客分类:
  • java
 
阅读更多
the three strategies:
  • table per class hierarchy
  • table per subclass
  • table per concrete class


1.Table per class hierarchy
Suppose we have an interface Payment with the implementors CreditCardPayment and CashPayment. The table per class hierarchy mapping would display in the following way:
<class name="Payment" table="PAYMENT">
<id name="id" type="long" column="PAYMENT_ID">
<generator class="native"/>
</id>
<discriminator column="PAYMENT_TYPE" type="string"/>
<property name="amount" column="AMOUNT"/>
...
<subclass name="CreditCardPayment" discriminator-value="CREDIT">
<property name="creditCardType" column="CCTYPE"/>
...
</subclass>
<subclass name="CashPayment" discriminator-value="CASH">
...
</subclass>
</class>

Exactly one table is required. There is one limitation of this mapping:columns declared by the subclass cannot have not null constraints.
分享到:
评论

相关推荐

    IBatis: Discriminator Column Example – Inheritance Mapping(Ibatis中的继承映射)

    NULL 博文链接:https://copperfield.iteye.com/blog/1140058

    04-hibernate-Component_and_Inheritance_Mapping

    Component and Inheritance Mapping Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/Course-Materials/hibernate.html

    Hibernate Recipes A Problem-Solution Approach

    How to do various mappings, including one-to-one mapping, many-to-one mapping, collection mapping, component mapping, and inheritance mapping How to use Hibernate Query Language (HQL) How to perform ...

    Hibernate 3.6.0.Final Reference PDF 手册

    第 10 章 继承映射(Inheritance Mapping) 第 11 章 与对象共事 第 12 章 Read-only entities 第 13 章 事务和并发 第 14 章 拦截器与事件(Interceptors and events) 第 15 章 批量处理(Batch...

    Hibernate Reference Documentation3.1

    9. Inheritance Mapping 9.1. The Three Strategies 9.1.1. Table per class hierarchy 9.1.2. Table per subclass 9.1.3. Table per subclass, using a discriminator 9.1.4. Mixing table per class hierarchy ...

    hibernate_reference中文文档.pdf

    4.2. 实现继承(Inheritance) ............................................... 53 4.3. 实现 equals() 和 hashCode() 方法: ................................... 54 4.4. 动态模型(Dynamic models) ............

    hibernate3.6 文档(pdf 格式)

    1.1.3. The mapping file ...................................................................................... 4 1.1.4. Hibernate configuration ...........................................................

    Statistics of Gene Mapping

    Gene mapping is used in experimental genetics to improve the hardiness or productivity of animals or plants of agricultural value, to explore basic mechanisms of inheritance, or to study animal models...

    Java.Persistence.with.Hibernate.2nd.Edition

    We show you how to deal with inheritance, collections, and complex class associations. Finally, we discuss integration with legacy database schemas and some mapping strategies that are especially ...

    NHibernate中文文档

    实现继承(Inheritance) 7 实现Equals()和GetHashCode() 7 持久化生命周期(Lifecycle)中的回调(Callbacks) 7 合法性检查(Validatable)回调 7 用属性替代 XML 7 第4章 O/R Mapping基础 7 让我们从一个映射的...

    .NET mvc5 code first 教程

    Creating a data model using data annotations attributes, and fluent API for database mapping. Performing basic CRUD operations. Filtering, ordering, and grouping data. Working with related data. ...

    Entity Framework Tutorial

    technology, is an extended Object Relational Mapping (ORM) technology that makes it easy to tie together the data in your database with the objects in your applications. This is done by abstracting ...

    Hibernate框架参考文档

    5. 对象/关系数据库映射基础(Basic O/R Mapping); 6. 集合类(Collections)映射; 7. 关联关系映射; 8. 组件(Component)映射; 9. 继承映射(Inheritance Mappings); 10. 与对象共事; 11. 事务和并发; 12. 拦截器与...

    TMS Aurelius 2.2

    TMS Aurelius is an Object-Relational Mapping (ORM) framework. Its purpose is to be the definitive ORM framewok for the Delphi/C++ Builder environment, with full support for data manipulation, complex ...

    aurelius_manual.chm

    TMS Aurelius is an Object-Relational Mapping (ORM) framework. Its purpose is to be the definitive ORM framewok for the Delphi environment, with full support for data manipulation, complex and advanced...

    NHibernate中文帮助手册API

    实现继承(Inheritance)  4.3. 实现 Equals() 和 GetHashCode() 方法  4.4. 持久化生命周期(Lifecycle)中的回调(Callbacks)  4.5. 合法性验证(IValidatable)回调  5. 对象/关系数据库映射基础(Basic...

    New NHibernate + Sample Source Part2

    inheritance, polymorphism, composition and the .NET collections framework, including generic collections. * Native .NET - NHibernate API uses .NET conventions and idioms * Support for fine-...

    New NHibernate + Sample Source Part1

    inheritance, polymorphism, composition and the .NET collections framework, including generic collections. * Native .NET - NHibernate API uses .NET conventions and idioms * Support for fine-...

    NHibernate 2.0.1 + Movies + Sample Source Part2

    inheritance, polymorphism, composition and the .NET collections framework, including generic collections. * Native .NET - NHibernate API uses .NET conventions and idioms * Support for fine-...

Global site tag (gtag.js) - Google Analytics