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表中结果,插入成功
分享到:
相关推荐
that allows you to select a folder.<END><br>87,browsfil.zip<br>A text box type control, that allows you to select a file..<END><br>88,colbrwse.zip<br>A colour select control.<END><br>89,colorsel.zip...
The 80x86 MOV Instruction<br>4.8 - Some Final Comments on the MOV Instructions<br><br>4.9 Laboratory Exercises<br>4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers<br>4.9.2 ...
<br><br><br>以下是更加详细的内容,请接着阅读:<br><br><br>一、修正bugs <br><br>1. 把 mosDatabase 类名恢复为原来的 database<br>有些组件直接调用 database 类,改名会造成无法正常使用,权衡再三,还是改回来...
IDirectSound8::SetSpeakerConfig<br>The SetSpeakerConfig method specifies the speaker configuration of the device.<br><br>HRESULT SetSpeakerConfig(<br> DWORD dwSpeakerConfig<br>);<br>IDirectSound8::...
The following table describes the units of the time format.<br><br>Name Units<br>us Microseconds<br>ms Milliseconds<br>sc Seconds<br>mn Minutes<br>hr Hours<br>dy Days<br><br><br>Cmd.Phase.Ofs(rep)<br...
noreturn.zip<br>Disable the Return Key in a TextBox<END><br>60,entertab.zip<br>Use the Enter Key Like a Tab<END><br>61,detenter.zip<br>Detect When the User Presses Enter<END><br>62,prntscrn.zip<br>...
<br><br> m_hDC = CreateCompatibleDC(0) <br> If (m_hDC <> 0) Then <br> If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then <br> m_hBmpOld = SelectObject(m_hDC, m_hDIb) <br> Create = True <br> Else <br...
<br><br> m_hDC = CreateCompatibleDC(0) <br> If (m_hDC <> 0) Then <br> If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then <br> m_hBmpOld = SelectObject(m_hDC, m_hDIb) <br> Create = True <br> Else <br...
<br>}<br></script><br></head><br><body><br><form id="form1" runat="server"><br><asp:ScriptManager ID="ScriptManager1" runat="server"><br><Services><br><asp:ServiceReference Path="~/WebServices/...
<code>Store</code> and <code>Message</code> objects returned from the standard JavaMail APIs. <P> The Sun protocol providers also support properties that are specific to those providers. The package ...
<artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <url>http://127.0.0.1:8082/manager/text</url> <server>tomcat2</server> <path>/spring3JDBC</path> </...
<returns>An object that represents the saved parameters is returned.</returns> </member> - <member name="M:Symbol.API.Restore(System.Object)"> <summary>Abstract method provides the capability to ...
/// <param name="pFileName"> RAW file where to store the generated signal. The signal is encoded with a sample rate of 22050Hz, format S16_LE, 2 channels. </param> public void sayToFile( String...
<item>"bt-pan"</item> </string-array> 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, ...
<p>one</p> <div><p>two</p></div> <p>three</p> jQuery 代码: $("div > p"); 结果: [ <p>two</p> ] -------------------------------------------------------------------------------- 在文档的第一个表单...
Cannot access field <fieldname> as type variant." * 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...
<td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> </table> </body> </html> 给tr设置relative后就能相对table定位了,看来很简单啊,但问题是这个方法ie8和ff都无效,而且存在很多问题,所以...
</TITLE> </HEAD> <BODY> <H1> First PHP page </H1> <HR> <? // Single line C++ style comment /* printing the message */ echo "Hello World!"; # Unix style single line comment ?> </BODY> </HTML> 2.4 数据...
<item>"bt-pan"</item> </string-array> 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预览版), *************************************************** * Version 1.0.0 升级日志 *... configured in the <Items> property of <ext:CompositeField>.