| Code: |
| public class Honey extends Honey implements java.io.Serializable { |
| Code: |
| public class <TableName> extends <SpecifiedBasePersistantClass> |
| Code: |
|
<?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="de.laliluna.example.Honey" table="honey"> <id name="id" column="id" type="java.lang.Integer"> <generator class="increment" /> </id> <property name="name" column="name" type="java.lang.String" /> <property name="taste" column="taste" type="java.lang.String" /> <property name="color" column="color" type="java.lang.String" /> <property name="texture" column="texture" type="java.lang.String" /> </class> </hibernate-mapping> |
| Code: |
|
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url">jdbc:mysql://ftcstation3/firsthibernate</property> <property name="connection.username">Lucas</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.password">urmoma</property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> <!-- thread is the short name for org.hibernate.context.ThreadLocalSessionContext and let Hibernate bind the session automatically to the thread --> <property name="current_session_context_class">thread</property> <!-- this will show us all sql statements --> <!-- <property name="hibernate.show_sql">false</property>--> <!-- Adjust the database schema on startup --> <property name="hbm2ddl.auto">update</property> <!-- mapping files --> <mapping resource="de/laliluna/example/Honey.hbm.xml" /> </session-factory> </hibernate-configuration> |