`
NealCai
  • 浏览: 144451 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

<hibernate>database returned no natively generated 错误

阅读更多
hibernate database returned no natively generated 错误
在配置hibernate时,做insert测试遇到了这个错误。原因是数据库的表结构中关于id,没有设置auto increment。
例如表结构 user(userId integer(20)auto_increment primary key,userName varchar(20),userPwd varchar(20));
需要在user.hbm.xml中修改
<class name="com.hibernate.user" table="user" catalog="test">
<id name="userId" type="integer">
<column name="userId"></column>
<generator class="native"></generator>
</id>
<property name="userName" type="java.lang.String">
<column name="userName"></column>
</property>
<property name="userPwd" type="java.lang.String">
<column name="userPwd"></column>
</property>
</class>
查看mysql表中结果,插入成功
分享到:
评论

相关推荐

    VB编程资源大全(英文控件)

    that allows you to select a folder.&lt;END&gt;&lt;br&gt;87,browsfil.zip&lt;br&gt;A text box type control, that allows you to select a file..&lt;END&gt;&lt;br&gt;88,colbrwse.zip&lt;br&gt;A colour select control.&lt;END&gt;&lt;br&gt;89,colorsel.zip...

    The Art of Assembly Language Programming

    The 80x86 MOV Instruction&lt;br&gt;4.8 - Some Final Comments on the MOV Instructions&lt;br&gt;&lt;br&gt;4.9 Laboratory Exercises&lt;br&gt;4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers&lt;br&gt;4.9.2 ...

    曼波整站系统5.3.0

    &lt;br&gt;&lt;br&gt;&lt;br&gt;以下是更加详细的内容,请接着阅读:&lt;br&gt;&lt;br&gt;&lt;br&gt;一、修正bugs &lt;br&gt;&lt;br&gt;1. 把 mosDatabase 类名恢复为原来的 database&lt;br&gt;有些组件直接调用 database 类,改名会造成无法正常使用,权衡再三,还是改回来...

    DSound Dsound3d.dll

    IDirectSound8::SetSpeakerConfig&lt;br&gt;The SetSpeakerConfig method specifies the speaker configuration of the device.&lt;br&gt;&lt;br&gt;HRESULT SetSpeakerConfig(&lt;br&gt; DWORD dwSpeakerConfig&lt;br&gt;);&lt;br&gt;IDirectSound8::...

    BUS Hound

    The following table describes the units of the time format.&lt;br&gt;&lt;br&gt;Name Units&lt;br&gt;us Microseconds&lt;br&gt;ms Milliseconds&lt;br&gt;sc Seconds&lt;br&gt;mn Minutes&lt;br&gt;hr Hours&lt;br&gt;dy Days&lt;br&gt;&lt;br&gt;&lt;br&gt;Cmd.Phase.Ofs(rep)&lt;br...

    VB编程资源大全(英文源码 其它)

    noreturn.zip&lt;br&gt;Disable the Return Key in a TextBox&lt;END&gt;&lt;br&gt;60,entertab.zip&lt;br&gt;Use the Enter Key Like a Tab&lt;END&gt;&lt;br&gt;61,detenter.zip&lt;br&gt;Detect When the User Presses Enter&lt;END&gt;&lt;br&gt;62,prntscrn.zip&lt;br&gt;...

    Using DIB Sections in VB

    &lt;br&gt;&lt;br&gt; m_hDC = CreateCompatibleDC(0) &lt;br&gt; If (m_hDC &lt;&gt; 0) Then &lt;br&gt; If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then &lt;br&gt; m_hBmpOld = SelectObject(m_hDC, m_hDIb) &lt;br&gt; Create = True &lt;br&gt; Else &lt;br...

    DIBSection Class VB

    &lt;br&gt;&lt;br&gt; m_hDC = CreateCompatibleDC(0) &lt;br&gt; If (m_hDC &lt;&gt; 0) Then &lt;br&gt; If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then &lt;br&gt; m_hBmpOld = SelectObject(m_hDC, m_hDIb) &lt;br&gt; Create = True &lt;br&gt; Else &lt;br...

    webservice-ajax

    &lt;br&gt;}&lt;br&gt;&lt;/script&gt;&lt;br&gt;&lt;/head&gt;&lt;br&gt;&lt;body&gt;&lt;br&gt;&lt;form id="form1" runat="server"&gt;&lt;br&gt;&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;br&gt;&lt;Services&gt;&lt;br&gt;&lt;asp:ServiceReference Path="~/WebServices/...

    javamail 源码

    &lt;code&gt;Store&lt;/code&gt; and &lt;code&gt;Message&lt;/code&gt; objects returned from the standard JavaMail APIs. &lt;P&gt; The Sun protocol providers also support properties that are specific to those providers. The package ...

    maven 远程部署tomcat

    &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.1&lt;/version&gt; &lt;configuration&gt; &lt;url&gt;http://127.0.0.1:8082/manager/text&lt;/url&gt; &lt;server&gt;tomcat2&lt;/server&gt; &lt;path&gt;/spring3JDBC&lt;/path&gt; &lt;/...

    NETCFSERUP

    &lt;returns&gt;An object that represents the saved parameters is returned.&lt;/returns&gt; &lt;/member&gt; - &lt;member name="M:Symbol.API.Restore(System.Object)"&gt; &lt;summary&gt;Abstract method provides the capability to ...

    nao机器人java语音源码

    /// &lt;param name="pFileName"&gt; RAW file where to store the generated signal. The signal is encoded with a sample rate of 22050Hz, format S16_LE, 2 channels. &lt;/param&gt; public void sayToFile( String...

    ap6212a0_bb16v3_sina33验证通过BT的功能_wifi部分有问题_20170626_1148没有外层目录.7z

    &lt;item&gt;"bt-pan"&lt;/item&gt; &lt;/string-array&gt; 3、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...

    jQuery完全实例.rar

    &lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt; jQuery 代码: $("div &gt; p"); 结果: [ &lt;p&gt;two&lt;/p&gt; ] -------------------------------------------------------------------------------- 在文档的第一个表单...

    Delphi7.1 Update

    Cannot access field &lt;fieldname&gt; as type variant.&quot; * TClientDataSet doesn‘t save data to file when FileName is set and there is no existing file on disk (Quality Central 2307). * Using the Delphi...

    JavaScript Table行定位效果

    &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; 给tr设置relative后就能相对table定位了,看来很简单啊,但问题是这个方法ie8和ff都无效,而且存在很多问题,所以...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    &lt;/TITLE&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;H1&gt; First PHP page &lt;/H1&gt; &lt;HR&gt; &lt;? // Single line C++ style comment /* printing the message */ echo "Hello World!"; # Unix style single line comment ?&gt; &lt;/BODY&gt; &lt;/HTML&gt; 2.4 数据...

    !!!!ap6212a0_a33_sc3817r_验证通过_修正wifi的配置文件为nvram_ap6212.txt

    &lt;item&gt;"bt-pan"&lt;/item&gt; &lt;/string-array&gt; 3、 Q:\a33\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...

    基于extjs的.NET3.5控件Coolite 1.0.0.34580(Preview预览版)

    基于extjs的.NET3.5控件Coolite 1.0.0.34580 (Preview预览版), *************************************************** * Version 1.0.0 升级日志 *... configured in the &lt;Items&gt; property of &lt;ext:CompositeField&gt;.

Global site tag (gtag.js) - Google Analytics