zoukankan      html  css  js  c++  java
  • NHibernate的陷井

          这几天公司准备用NHibernate作为基础框架,上网搜了搜,NHibernate官网提供了几个版本,最基础的是NHibernate,然后NHibernate.Burrow是对前者做了一些封装,NHibernate.Burrow.AppBlock则进一步进行了封装,看了下,确实很方便,于是自己动手写点玩意。

          帮助文档都是E文版,所有又好用又不要钱的玩意好像都是外国人搞出来的,好在还不难懂。官网下了个例子,结果中了一个招。请看帮助文档:

    Now consider a model of the relationships between Customer, Order and LineItem and Product. There is a one-to-many association between Customer and Order, but how should we represent Order / LineItem / Product? I've chosen to map LineItem as an association class representing the many-to-many association between Order and Product. In NHibernate, this is called a composite element.

    Code
          请看子表名:Order
    官网的例子有个Create_SQL的建表语句,如果你按照这个例子做下去,搞一对多的测试,会发现无论如何都会报错,
    嘿嘿,想到原因没?老夫我找了好久才搞明白,浪费了大量脑细胞啊。
          NHibernate中用代码工具生成的实体类必须要将XML映射文件选成嵌入的资源,才可以正常使用。
  • 相关阅读:
    6-hadoop的运行模式(完全分布式)(上)
    5-hadoop的运行模式(伪分布式)
    4-hadoop的运行模式(本地)
    3-hadoop-安装hadoop
    2-hadoop-Hadoop以及生态
    word文档在线预览解决方案
    那些有意思的Github
    Git
    squid,nginx,lighttpd反向代理的区别
    redhat6 改 centos yum 源
  • 原文地址:https://www.cnblogs.com/millen/p/1404786.html
Copyright © 2011-2022 走看看