Hi,

if you use a Timestamp or Datetime like 2008-12-10 11:12 you need to map that in the class as:

@Column(name="mydatetime")
@Temporal(TemporalType.TIMESTAMP)
public getMyDateTime(){
   return myDateTime;
}

See Hibernates TemporalType for further informations.

I don't think you need to use <![CDATA[  ]]

regards

John Kwon schrieb:
On Thu, Sep 4, 2008 at 12:46 PM, oad <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    Hi,
    I installed AppFuse2 Spring MVC modular and I've been adding my
    own classes
    to the Hibernate model package. I am using MySQL5
    Everything was fine until and introduced a Date element on the DB
    model. The
    structure on the database is always created correctly(datetime type on
    MySQL) but when I am trying to autopopulate data from an XML file
    by running
    mvn command from the root project I get the error below:

    I have tried java.util.Date, java.sql.Date and java.util.Calendar
    but no
    luck so far

    On the default-data.xml file this is what i have:

      <table name="tbl_events">
           <column>event_id</column>
           <column>event_name</column>
           <column>description</column>
           <column>start_date</column>
           <column>end_date</column>
           <column>address</column>
           <column>province</column>
           <column>city</column>
           <column>country</column>
           <column>postal_code</column>
           <column>total_distance_km</column>
           <column>type_id</column>
           <row>
               <value description="event_id">1</value>
               <value description="event_name">Event name1 example</value>
               <value description="description">Event description1
    example</value>
               <value description="address">123 main st</value>
               <value description="city">New York</value>
               <value description="country">US</value>
               <value description="start_date">2008-09-11 10:45:40</value>
               <value description="end_date">2008-09-11 10:45:40</value>
               <value description="total_distance_km">10</value>
               <value description="postal_code">10014</value>
               <value description="province">NY</value>
               <value description="type_id">1</value>
           </row>
           .

<snip>

Ok, you need to put the dates in your XML file as follows:

<value description="start_date"><![CDATA[2007-08-15]]></value>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to