1, add hibernate support on the project, import the related package, modify the configuration file as follows:
Hibernate.cfg.xml file
<?XML version= ' 1.0 ' encoding= ' UTF-8 '?><!DOCTYPE hibernate-configuration Public "-//hibernate/hibernate configuration DTD 3.0//en" "Http://hi Bernate.sourceforge.net/hibernate-configuration-3.0.dtd "><!--Generated by MyEclipse Hibernate Tools. -<hibernate-configuration> <session-factory> < Propertyname= "Connection.driver_class">Com.mysql.jdbc.Driver</ Property> < Propertyname= "Connection.url">jdbc:mysql://localhost:3306/nljxjoatest</ Property> < Propertyname= "Connection.username">Root</ Property><!--connection user name for the configuration database - < Propertyname= "Connection.password">Root</ Property><!--Configure the connection password for the database, where the password is empty, in which case you can omit the line configuration code - < Propertyname= "dialect">Org.hibernate.dialect.MySQLDialect</ Property> < Propertyname= "Show_sql">True</ Property><!--Configuring the display of SQL statements in the console - < Propertyname= "Format_sql">True</ Property><!--Configure the output SQL statement to be formatted - < Propertyname= "Use_sql_comments">True</ Property><!--Configure to add a hint before the SQL statement of the output - <MappingResource= "Cn/ace/domain/smshistory.hbm.xml" /> <MappingResource= "Cn/ace/domain/smsmobile.hbm.xml" /> </session-factory></hibernate-configuration>
2 Open MyEclipse db Browser, generate domain entity, see as: