-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Facing many problems using 1.2.0 in mapping file.....
PostPosted: Fri Jul 13, 2007 7:07 am 
Newbie

Joined: Thu Jul 12, 2007 1:13 am
Posts: 17
ActuallyI'm faciling lots of problem using NHibernate 1.2.0 in mapping file....actaully My project needs to be migrated from java to .NET and the database is built on Oracle.So using NHibernate I need to use the same Hibernate query files which were earlier used in the Java based project.But I'm facing lots of problem with the mapping files can any one tell what shoud be the NHibernate mapping file fro the below written Hibernate mapping file:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="com.bofa.sb.sbcs.web.model.data.Affiliate"
table="AFFILIATE"
>

<id
name="affilId"
type="java.math.BigDecimal"
column="AFFIL_ID"
>
<generator class="assigned" />
</id>

<property
name="lastUpdateDate"
type="java.sql.Timestamp"
column="LAST_UPDATE_DATE"
length="7"
/>


<property
name="custId"
type="java.lang.Integer"
column="CUST_ID"
/>
<property
name="affilNum"
type="java.lang.Long"
column="AFFIL_NUM"
/>
<many-to-one
name="customer"
class="com.bofa.sb.sbcs.web.model.data.Customer"
not-null="true"
>
<column name="affil_num" />
</many-to-one>

</class>
</hibernate-mapping>

It's the most challenging task in my project and I'm struck. Kindly tell me what should be the NHibernate version of this file using NHibernate1.2.0.GA

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 1.2.0.GA

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 12:09 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
First of all you'll need to change the types specified in the type attributes from java.lang.whatever to the appropriate NHibernate basic mapping types. Refer to the nhibernate_reference.pdf, section 5.2.2, that comes with 1.2.0GA.

For example, java.lang.Integer needs changing to Int32. Also, remove the length attribute for your timestamp property, I don't think it applies in .NET.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.