facebook

JPA reverse engineering and data types

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #292376 Reply

    Mike Suiter
    Member

    I’m trying to get the JPA reverse engineering to use TIMESTAMP instead of DATE for my types. I’ve tried several things with no luck. Here is the latest I’ve tried. Here is my jpa.reveng.xml file

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
    
    <hibernate-reverse-engineering>
        <table name="WPB_CONNECT" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Connect"></table>
        <table name="WPB_EXCEPTION" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.ServerException"></table>
        <table name="WPB_INI" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Ini"></table>
        <table name="WPB_JOB" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Job"></table>
        <table name="WPB_JOB_NODE" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.JobNode"></table>
        <table name="WPB_JOB_NODE_STATE_CHANGE" schema="dbo" catalog="bamdbcreate"
            class="com.workpoint.bam.domain.JobNodeStateChange">
        </table>
    <table name="WPB_JOB_STATE_CHANGE" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.JobStateChange">
        <primary-key>
            <column name="EVENT_DATE" jdbc-type="TIMESTAMP" type="java.util.Date"></column>
        </primary-key>
    </table>
    <table name="WPB_MILESTONE" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Milestone"></table>
        <table name="WPB_MONITOR_STATUS" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.MonitorStatus"></table>
        <table name="WPB_QUEUE_STATUS" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.QueueStatus"></table>
        <table name="WPB_SCRIPT" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Script"></table>
        <table name="WPB_SERVER" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.Server"></table>
        <table name="WPB_USER_EVENT" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.UserEvent"></table>
        <table name="WPB_WORK_ITEM" schema="dbo" catalog="bamdbcreate" class="com.workpoint.bam.domain.WorkItem"></table>
        <table name="WPB_WORK_ITEM_STATE_CHANGE" schema="dbo" catalog="bamdbcreate"
            class="com.workpoint.bam.domain.WorkItemStateChange">
        </table>
    </hibernate-reverse-engineering>

    When I look at the generated code, I see:

    
    @Temporal(TemporalType.DATE)
        @Column(name="EVENT_DATE", nullable=false, length=23)
    
        public Date getEventDate() {
            return this.eventDate;
        }
        
        public void setEventDate(Date eventDate) {
            this.eventDate = eventDate;
        }
    

    Is there a way to get all my SQL datetime columns to map to a TIMESTAMP type? If so, how do I do that?

    #292460 Reply

    Loyal Water
    Member

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me. We had fixed this issue in MyEclipse 7.0 GA.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JPA reverse engineering and data types

You must be logged in to post in the forum log in