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.  [ 4 posts ] 
Author Message
 Post subject: Not-Null constrains in Mapping file generated by Middlegen
PostPosted: Sun Aug 27, 2006 4:33 am 
Beginner
Beginner

Joined: Mon Aug 22, 2005 9:57 pm
Posts: 27
Dear All

I currently encounter a problem
I dont know if anybody else here having same experience with me or not.
I dont know if it is Middlegen's problem or problem from somewhere else

Problem is

I have a table
BILL_TYPE_GROUP_MEMBERS which reference to BILL_TYPE_GROUPS_TLI's Uniqe colum BILL_TYPE_GROUPS_TLI_ID

and BILL_TYPE_GROUPS_TLI_ID is defined as foregin key and not-null
for BILL_TYPE_GROUP_MEMBERS Table

But when Middlengen generate mapping files
this BILL_TYPE_GROUPS_TLI_ID is not declared as not-null=true.

see below mapping files,

And more wild thing is BILL_TYPE_GROUP_MEMBERS also
reference to some other Tables primary's key . those primary keys
are not defined as not null foreign keys for BILL_TYPE_GROUP_MEMBERS , but in mapping files generated by middlegen,
those foreign keys are defined as not-null="true". So it is totally another
way around which what I expected or what Table 's constrains defined.

Do you have any idea about this problem? It is problem from Middlegen or
problem from somewhere else?I used sqldeveloper to check my table's constrains, they all look correct.

<class
name="com.bearingpoint.infonova.psm.hibernate.BillTypeGroupMember"
table="BILL_TYPE_GROUP_MEMBERS"
>


<!-- bi-directional one-to-one association to BillTypeGroupsTli -->
<many-to-one
name="billTypeGroupsTli"
class="com.bearingpoint.infonova.psm.hibernate.BillTypeGroupsTli "
unique="true"
>
<meta attribute="field-description">
@hibernate.many-to-one
unique="true"
@hibernate.column name="BILL_TYPE_GROUPS_TLI_ID"
</meta>
<column name="BILL_TYPE_GROUPS_TLI_ID" />
</many-to-one>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 27, 2006 9:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Your not showing everything to help but it does indicate you selected the relationship to be a bi-directional one-to-one releationship. Is that what you wanted? It does have specific rendering rules depending on the association.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 12:56 am 
Beginner
Beginner

Joined: Mon Aug 22, 2005 9:57 pm
Posts: 27
Thanks for your reply
Did you find some thing wrong here below?
It should have not-null="true",but it is missing in below file gernerated by middlegen

<!-- bi-directional one-to-one association to BillTypeGroupsTli -->
<many-to-one
name="billTypeGroupsTli"
class="com.bearingpoint.infonova.psm.hibernate.BillTypeGroupsTli "
unique="true"
>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 8:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Its a part of the one-to-one templates which are a little bit more involved than plain many-to-one templates. I have not got alot of time to look at this (and I have not finished other work I have promissed Max). The templates are easy to change so I suggest you make the change and if all is good submit the patch. Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.