`
梅花灿
  • 浏览: 6065 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

The database returned no natively generated identity value的解决方案

 
阅读更多

在POJO的映射文件中配置如下:

<hibernate-mapping package="com.lpc.hibernate"> <class name="User" table="user"> <id name="id"> <generator class="identity"> </generator> </id> <property name="name" column="name"></property> <property name="password" column="password"></property> </class> </hibernate-mapping>


在指定主键生成策略的时候、配置了<generator class="identity"/> 、这是提供自动增长、为数据表中的主键自动增长、但是如果数据库没有定义id列为自动增长的话、就会出现The database returned no natively generated identity value错误、所以要在数据库中手动定义id列自动增长
分享到:
评论

相关推荐

    error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large

    git首次提交代码到远程仓库提示413错误,错误信息如下 git push --set-upstream origin master Enumerating objects: 153, done. ... HTTP 413 curl 22 The requested URL returned error: 413 Req

    event_utils.rar_The Returned

    Returns a ui::Event wrapping a native event. Ownership of the returned value is transferred to the caller.

    pci-swiotlb.rar_The Returned

    标题中的"pci-swiotlb.rar_The_Returned"暗示了我们正在处理与PCI(Peripheral Component Interconnect)总线相关的软件I/O页表别名(Software I/O Translation Lookaside Buffer)的更新或修复工作,其中"The_...

    mdesc.rar_The Returned

    Machine description operations are to be surrounded by grab and release calls. The mdesc_handle returned the grab is the first argument to all of the operational calls that work on mdescs.

    fifo.rar_The Returned

    This writes up to nbytes bytes to the FIFO If the head runs in to the tail, not all bytes are written The number of bytes written is returned

    hibernate常见错误解决方案

    **The database returned non-native generate identity value** **异常描述:** 此异常通常发生在尝试使用自动增长的主键生成策略时,数据库返回了一个非原生的标识符值。 **解决方法:** - 根据所使用的数据库...

    KMP.rar_C++_The Returned

    The classical KMP algorithm for string matching (the target string can be modified in the main function, if any match is found, the matching position would be returned)

    formatosImagen.rar_The Returned_YCbCr

    From a given image, this code returns it in the following colour spaces RGB,NTCS,YCBCR,HSV. The fields are returned in a matrix of dimensions (:,:,12)

    Dimeric.Virtual.Database.

    For example, the macro for the database‘s current date and time would be CURRENT for the Informix dialect and getdate() for the SQL Server dialect. In VDB you would use the [now()] function. If you ...

    BM.rar_BM-algorithm_Berlekamp-Massey_The Returned_berlekamp _bm

    The Berlekamp-Massey algorithm is an efficient algorithm for ... Returned value (L) is the length of the shortest linear feedback shift register sequence that generates all bits in sequence sn.

    exportplotdata_cmenu.rar_The Returned

    EXPORTPLOTDATA_CMENU Context menu to export plot data to workspace or file ... as returned by PLOT), which allows the user to export the line s data to a workspace variable or a file

    DataHash_20130330.zip_DataHash_The Returned_edge matching

    Scanning is done by rotating the template and matching it to the image in various of angles, the best match is returned. Matching the template generalized hough transform. See the ReadRe file in the ...

    mga_drv.rar_The Returned

    标题 "mga_drv.rar_The Returned" 暗示我们关注的是一个与图形处理相关的驱动程序,特别是针对MGA(可能是指Matrox G450)显卡的驱动。描述中提到,如果设备是PCI G450,函数将返回0,否则返回2。这表明在驱动程序中...

    OCI Programmer's Guide

    If the number being returned from Oracle Database is not an integer, the fractional part is discarded, and no error or other indication is returned. If the number to be returned exceeds the capacity ...

    The system Message Box that is closed atuomatically after so

    标题中的"The system Message Box that is closed automatically after some time"指的是一个自动关闭的系统消息框,这种...通过提供的资源,我们可以学习到具体的实现方法,并可能为自己的项目提供灵感或解决方案。

    微软内部资料-SQL性能优化5

    If there is no clustered index, there is a sysindexes row for the table with an indid value of 0, and that row will keep track of the address of the first IAM for the table. The IAM is a giant bitmap...

    数位板压力测试

    The availability of drivers that support the features of the specification will simplify the process of developing Windows appli¬cation programs that in-corporate absolute coordinate input, and ...

    nf_nat_proto_unknown.rar_The Returned

    The "unknown" protocol. This is what is used for protocols we don t understand. It s returned by ip_ct_find_proto, Linux API.

    计算机网络第六版答案

    transport-layer segment: generated by the transport layer and encapsulates application-layer message with transport layer header; network-layer datagram: encapsulates transport-layer segment with a ...

Global site tag (gtag.js) - Google Analytics