-->
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.  [ 7 posts ] 
Author Message
 Post subject: insert="false", update="false" not suppo
PostPosted: Thu May 20, 2004 11:40 am 
Beginner
Beginner

Joined: Wed Feb 18, 2004 1:28 pm
Posts: 20
Location: Rovereto - Italy
I have this mapping:
<component
name="comp"
class="eg.MyComponent"
>

<property
name="myProperty"
type="java.lang.String"
update="true"
insert="false"
column="COL"
not-null="false"
/>

...

</component>

I don't understand the reason of this exception: why have I to map in a component the same value for the attributes property's "insert" and "update"?

Could not compile the mapping document
net.sf.hibernate.MappingException: insert="false", update="false" not supported for properties of components: myProperty


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 2:27 pm 
Beginner
Beginner

Joined: Tue May 11, 2004 12:08 pm
Posts: 38
Location: Davis,CA,USA
hi,

if I understood your question right, you want to know at the first part of your question why you can say update = true, insert = false

simple example to explain this

you had an user with an adress this user cannot say I want to have a second adress (Insert into adresses values (....)) but it's allow to update his adress. (Update adress set "street" = ? where "id" = ?)

thats the reason, for your second part I don't know the right answer


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 4:51 pm 
Beginner
Beginner

Joined: Wed Feb 18, 2004 1:28 pm
Posts: 20
Location: Rovereto - Italy
Excuse me for my bad english, but I have only one question:

This mapping:
<component
name="comp"
class="eg.MyComponent"
>

<property
name="myProperty"
type="java.lang.String"
update="true"
insert="false"
column="COL"
not-null="false"
/>

...

</component>


give me this exception:

Could not compile the mapping document
net.sf.hibernate.MappingException: insert="false", update="false" not supported for properties of components: myProperty

WHY?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 6:04 pm 
Beginner
Beginner

Joined: Tue May 11, 2004 12:08 pm
Posts: 38
Location: Davis,CA,USA
whats about a database table? sorry using only hibernate with xdoclet. so the mapping files are generated automaticly


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 9:32 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Look the DTD for hibernate mapping files

<!ELEMENT property (meta*,column*)>
<!ATTLIST property name CDATA #REQUIRED>
<!ATTLIST property access CDATA #IMPLIED>
<!ATTLIST property type CDATA #IMPLIED>
<!ATTLIST property column CDATA #IMPLIED>
<!ATTLIST property length CDATA #IMPLIED>
<!ATTLIST property not-null (true|false) "false">
<!ATTLIST property unique (true|false) "false">
<!ATTLIST property update (true|false) "true"> <!-- only supported for properties of a class (not component) -->
<!ATTLIST property insert (true|false) "true"> <!-- only supported for properties of a class (not component) -->
<!ATTLIST property formula CDATA #IMPLIED> <!-- only supported for properties of a class (not component) -->


So you have an error in your mapping file


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:25 am 
Beginner
Beginner

Joined: Wed Feb 18, 2004 1:28 pm
Posts: 20
Location: Rovereto - Italy
Thank you.

Why the ATTLIST insert and update aren't supported for properties of a component?


Top
 Profile  
 
 Post subject: Re: insert="false", update="false" not suppo
PostPosted: Thu Jun 17, 2010 4:11 am 
Newbie

Joined: Tue Apr 13, 2010 2:23 am
Posts: 7
oh, I learned a lot

_________________
Hobbies Sports: Playing golf!

ping g10 driver*
ping g10 irons|


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.