1 回答
TA贡献1804条经验 获得超8个赞
create database test;
use test;
create table users(
id int(200)primary key AUTO_INCREMENT not null,
name varchar(255),
password varchar(255),
firstname varchar(255),
lastname varchar(255),
age int(200)
)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.s2sh.mobel.User" table="users">
<id name="id" column="id" type="integer">
<generator class="native"></generator>
</id>
<property name="name" column="name" type="string"/>
<property name="password" column="password" type="string"/>
<property name="firstname" column="firstname" type="string" not-null="false"/>
<property name="lastname" column="lastname" type="string" not-null="false"/>
<property name="age" column="age" type="integer" not-null="false"/>
</class>
</hibernate-mapping>
添加回答
举报