[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-621?page=all ]
Max Rydahl Andersen updated HBX-621:
------------------------------------
Fix Version: 3.2beta9
(was: 3.2beta8)
meta attribute of scope-get/set & inherit bug
---------------------------------------------
Key: HBX-621
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-621
Project: Hibernate Tools
Type: Bug
Versions: 3.1beta4
Environment: Hiberante 3.1.2
Hibernate Tools 3.1 beta 4
Reporter: Neil Buesing
Fix For: 3.2beta9
An inhertiable class level meta attribute of scope-get and scope-set cannot be overridden
within a property. Instead some string concat is being applied. This is different
behavior than with hibernate tools 2.1.3 and it is a potential bug (or at least a change
of behavior).
Hibernate 3 Mapping File
<?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 package="com.hibernate">
<class mutable="true" lazy="false"
name="com.hibernate.Test" table="TEST">
<meta attribute="scope-get">private</meta>
<meta attribute="scope-set">private</meta>
<id name="id" column="ID" type="long">
<generator class="assigned" />
</id>
<property name="col1" column="COL1"
type="java.lang.String">
<meta attribute="scope-get">public</meta>
</property>
<property name="col2" column="COL2"
type="java.lang.String">
<meta attribute="scope-set"></meta>
<meta attribute="scope-get">public</meta>
</property>
<property name="col3" column="COL3"
type="java.lang.String">
</property>
<property name="col4" column="COL4"
type="java.lang.String">
</property>
</class>
</hibernate-mapping>
Hibernate 3 Generated File
package com.hibernate;
// Generated Mar 16, 2006 10:00:19 AM by Hibernate Tools 3.1.0.beta4
/**
* Test generated by hbm2java
*/
public class Test implements java.io.Serializable {
// Fields
private long id;
private String col1;
private String col2;
private String col3;
private String col4;
// Constructors
/** default constructor */
public Test() {
}
/** minimal constructor */
public Test(long id) {
this.id = id;
}
/** full constructor */
public Test(long id, String col1, String col2, String col3, String col4) {
this.id = id;
this.col1 = col1;
this.col2 = col2;
this.col3 = col3;
this.col4 = col4;
}
// Property accessors
privatepublicpublic long getId() {
return this.id;
}
private void setId(long id) {
this.id = id;
}
privatepublicpublic String getCol1() {
return this.col1;
}
private void setCol1(String col1) {
this.col1 = col1;
}
privatepublicpublic String getCol2() {
return this.col2;
}
private void setCol2(String col2) {
this.col2 = col2;
}
privatepublicpublic String getCol3() {
return this.col3;
}
private void setCol3(String col3) {
this.col3 = col3;
}
privatepublicpublic String getCol4() {
return this.col4;
}
private void setCol4(String col4) {
this.col4 = col4;
}
}
Hibernate 2 Mapping File
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="com.hibernate">
<class mutable="true" lazy="false"
name="com.hibernate.Test" table="TEST">
<meta attribute="scope-get">private</meta>
<meta attribute="scope-set">private</meta>
<id name="id" column="ID" type="long">
<generator class="assigned" />
</id>
<property name="col1" column="COL1"
type="java.lang.String">
<meta attribute="scope-get">public</meta>
</property>
<property name="col2" column="COL2"
type="java.lang.String">
<meta attribute="scope-set"></meta>
<meta attribute="scope-get">public</meta>
</property>
<property name="col3" column="COL3"
type="java.lang.String">
</property>
<property name="col4" column="COL4"
type="java.lang.String">
</property>
</class>
</hibernate-mapping>
Hibernate 2 Generated File
package com.hibernate;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class Test implements Serializable {
/** identifier field */
private Long id;
/** nullable persistent field */
private String col1;
/** nullable persistent field */
private String col2;
/** nullable persistent field */
private String col3;
/** nullable persistent field */
private String col4;
/** full constructor */
public Test(Long id, String col1, String col2, String col3, String col4) {
this.id = id;
this.col1 = col1;
this.col2 = col2;
this.col3 = col3;
this.col4 = col4;
}
/** default constructor */
public Test() {
}
/** minimal constructor */
public Test(Long id) {
this.id = id;
}
private Long getId() {
return this.id;
}
private void setId(Long id) {
this.id = id;
}
public String getCol1() {
return this.col1;
}
private void setCol1(String col1) {
this.col1 = col1;
}
public String getCol2() {
return this.col2;
}
void setCol2(String col2) {
this.col2 = col2;
}
private String getCol3() {
return this.col3;
}
private void setCol3(String col3) {
this.col3 = col3;
}
private String getCol4() {
return this.col4;
}
private void setCol4(String col4) {
this.col4 = col4;
}
public String toString() {
return new ToStringBuilder(this)
.append("id", getId())
.toString();
}
}
see also forum topic
http://forum.hibernate.org/viewtopic.php?t=956894#2296725
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira