-->
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: XDoclet ignors hibernate tags update&insert
PostPosted: Wed Oct 19, 2005 9:37 am 
Newbie

Joined: Fri Oct 14, 2005 3:47 pm
Posts: 5
Location: Israel
XDoclet ignors update="false" and insert="false" in any tags of @hibernate

Example:

I have java file:
/**
* @hibernate.class
* table="ANIMALS"
* dynamic-update="true"
*
* @hibernate.discriminator column="disc"
* not-null="true"
* force="false"
*/
public class Animal{

private Integer id;
private char sex;

/**
* Constructor for Animal.
*/
public Animal() {
super();
}

/**
* @hibernate.id
*/
public Integer getId(){
return this.id;
}

public void setId(Integer id){
this.id=id;
}

/**
* @hibernate.property
* not-null="true"
* update="false"
* insert="false"
* Returns the sex.
* @return char
*/
public char getSex() {
return sex;
}

/**
* Sets the sex.
* @param sex The sex to set
*/
public void setSex(char sex) {
this.sex = sex;
}
}

After generating with XDoclet I have:

<?xml version="1.0" encoding="UTF-8"?>

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

<hibernate-mapping
>
<class
name="test.hibernate.Animal1"
table="ANIMALS"
>

<id
name="id"
column="id"
type="java.lang.Integer"
>
<generator class="">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Animal1.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<discriminator
column="disc"
not-null="true"
force="false"
/>

<property
name="sex"
type="char"
column="sex"
not-null="true"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Animal1.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>

in property sex XDoclet don't set update="false" and insert="false" I don't understand why. Is anybody know how can I solve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 8:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
What version of XDoclet are you using?
also Show the Ant script.

Shoudl be working but maybe there is a version number bug present but then again not sure hence need the version you are using. I would suggest you use the CVS version which will become version 1.3.x [assuming your not using v2] as alot of work went into this version for Hibernate 3.x .


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 6:52 am 
Newbie

Joined: Fri Oct 14, 2005 3:47 pm
Posts: 5
Location: Israel
I am using xdoclet 1.2.2 with patch xdoclet-hibernate-module-1[1].2.2.h3.for142.jar for hibernate 3.0 support from http://opensource2.atlassian.com/projec ... e/XDT-1257

But this patch has bug: tags insert and update not work

So, I start to use xdoclet 1.2.3, it supports adding the header in hbm.xml file for hibernate 3.0, this corresponds to my requirements for now.

what is CVS version? and where I can get it?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 23, 2005 8:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
OK 1.2.3 is the first release with some H3 support (no patching required). Version 1.3.x is the next release which you will have to get out of the source code control system and built it. See XDoclet site for instructions.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.