Elielson Silva (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNTI2ZWI1Y2Rl...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14127?atlOrigin=eyJpIjoiNTI2ZW...
) HHH-14127 (
https://hibernate.atlassian.net/browse/HHH-14127?atlOrigin=eyJpIjoiNTI2ZW...
) HHH000474 error on Boolean attribute with get and is getters and transient element not
working for methods while mapping class on orm.xml (
https://hibernate.atlassian.net/browse/HHH-14127?atlOrigin=eyJpIjoiNTI2ZW...
)
Issue Type: Bug Affects Versions: 5.4.19 Assignee: Unassigned Created: 29/Jul/2020 17:35
PM Priority: Major Reporter: Elielson Silva (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
My orm.xml file despite that listing and allowing me to use the `transient` tag to a
method, the transient state is not being applied to this method, as it would be if it was
on the @Transient.
Due to that and I'm getting an error:
```
HHH000474: Ambiguous persistent property methods detected on model.Test; mark one as
@Transient : [public java.lang.Boolean model.Test.getDefaultProfile()] and [public
java.lang.Boolean model.Test.isDefaultProfile()] : origin(model.Test)
```
And also a warning:
```
WARN: HHH000207: Property model.Test.getDefaultProfile not found in class but described in
<mapping-file/> (possible typo error)
```
This is how is my orml.xml, which I was expecting to solve the error with the
<transient> tag
<?xml version= "1.0" encoding= "UTF-8" ?>
<entity-mappings version= "2.1"
xmlns= "http://xmlns.jcp.org/xml/ns/persistence/orm"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= "http://xmlns.jcp.org
http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd" >
<entity class= "model.Test" >
<attributes>
<id name= "id" />
<transient name= "getDefaultProfile" />
</attributes>
</entity>
</entity-mappings>
And this is the class, that has a Boolean object on it and has the `get` and `is`
implemented on it. And on the real scenario due to being a class from an external
dependency, I'm using XML mapping over it:
public class Test {
protected Integer id;
protected Boolean defaultProfile;
public Integer getId() {
return id;
}
public void setId( Integer id) {
this.id = id;
}
public Boolean getDefaultProfile() {
return this.defaultProfile;
}
public Boolean isDefaultProfile() {
return this.defaultProfile;
}
public void setDefaultProfile( Boolean value) {
this.defaultProfile = value;
}
}
And the very off from this is that if I just annotate the class with @Entity that error
will not be shown
(
https://hibernate.atlassian.net/browse/HHH-14127#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14127#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100140- sha1:42b370d )