hibernate configauration file

G

gk

tutorial
http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html
here is config file from this tutorial
===========

<hibernate-mapping>

<class name="Event" table="EVENTS">
<id name="id" column="EVENT_ID"> // why type is missing here ?
<generator class="increment"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/> //
type is here.
<property name="title"/> // why type is missing here ?
</class>

</hibernate-mapping>


i am surprised to see that some cases in the above "type" has been
mentioned and some other cases "type" has been skipped .


why it is like this ?
 
R

Roedy Green

<property name="title"/> // why type is missing here ?

one answer is, if you look in the DTD describing Hibernate XML
http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd
you discovered the type field is #IMPLIED

In other words it has a default. You will have to read the Hibernate
docs to find out what that default is. It is probably whatever SQL
says it is.

Part of what JDBC-Hibernate is about is automatic translation of Java
types to SQL types.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top