facebook

Hibernate Mapping

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #228702 Reply

    Thomas Trostel
    Participant

    Whats wrong with this picture?

    
    <hibernate-mapping package="xxx.dao">
    
        <class name="Batches" table="batches">
            <cache usage="nonstrict-read-write"/>
            <id name="batchId" column="BATCH_ID" type="java.lang.String">
                <generator class="assigned"/>
            </id>
     
            <property name="processId" column="PROCESS_ID" type="java.lang.String"  not-null="true" />
            <property name="payDocDate" column="PAY_DOC_DATE" type="java.util.Date" />
            <property name="totalRecSum" column="TOTAL_REC_SUM" type="java.lang.Long" />
            <property name="totalRecTxns" column="TOTAL_REC_TXNS" type="java.lang.Long" />
            <property name="totalRecError" column="TOTAL_REC_ERROR" type="java.lang.Long" />
            <property name="createId" column="CREATE_ID" type="java.lang.String" />
            <property name="createDate" column="CREATE_DATE" type="java.util.Date" />
    
            <set name="myInvoices">
                <key column="BATCH_ID" not-null="true"/>
                <one-to-many class="Invoices"/>
            </set>
    
    
        </class>
        
    </hibernate-mapping>
    

    I believe this used to work with Hibernate 2 but Hibernate 3 doesn’t like the set declaration portion. Maybe its something really small or a quirk with the newer version.

    Thanks in advance 🙂

    #228716 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev (We don’t support Hib 3 yet :D)

    Please correct me if this is a) generated by ME and b) broken with Hibernate 2, then I will move it back.

    #228725 Reply

    Thomas Trostel
    Participant

    Perfectly understandable that Hibernate 3 isn’t supported by 3.8.1. I did figure since you all were writing version 4 now that you had probably run across this particular nasty. We do have a pretty diverse group of users on this forum who might be able to answer the question too so I just threw it out there for anyone to answer.

    Oh … BTW … if you’re using the new Hibernate 3 remember that you can’t use a java.util.Date as a key element any more. You can use a java.util.Calendar and get around the problem that way but the error message provided is a bit cryptic and not very helpful.

    #228728 Reply

    Riyad Kalla
    Member

    Thx Tom, I kicked this off to our hib dev to bookmark.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate Mapping

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