Java Reference
In-Depth Information
<property name="StatusCode"
column="status_code"
type="string"
not-null="true"
length="1"/>
<property name="ModeSCode"
column="mode_s_code"
type="string"
not-null="true"
length="8"/>
<property name="FractOwner"
column="fract_owner"
type="string"
not-null="true"
length="1"/>
<property name="LastActionDate"
column="last_action_date"
type="date"
not-null="true"
length="10"/>
<property name="AirWorthDate"
column="air_worth_date"
type="date"
not-null="true"
length="10"/>
</class>
</hibernate-mapping>
This XML file lets Hibernate know that the Aircraft class maps to the aircraft
table, and also defines the mapping between the table's columns and the class fields.
Hibernate needs another XML configuration file, which allows it to know the
database connection information and what XML files to use to map database tables
to Java classes. This XML configuration file is called hibernate.cfg.xml .
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- local connection properties -->
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/flightstats
</property>
 
Search WWH ::




Custom Search