MappingException thrown when entity/component class defines a 2 matching getters by stem name, one of them transient

Description

The hibernate entity to schema validator fails on a scenario where you have a bean with a nullable Boolean getter/setter and also a convenience primitive boolean method decorated with a @Transient annotation.

Ideally the validator would recognize javax.persistence.Transient annotated methods and ignore them when validating the database schema.

Reproduce with a JPA entity with the following:
@Column(name = COLUMN_ACTIVE, nullable = true)
public Boolean getActive()
{ return active; }
public void setActive(Boolean active)
{ this.active = active; }
@Transient
public boolean isActive()
{ return this.active == null ? false : this.active.booleanValue(); }

Actual error message is:
Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: DATASOURCE_JNDI] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.hibernate.MappingException: In trying to locate getter for property [active], Class [CLASS_NAME] defined both a `get` [public java.lang.Boolean CLASS_NAME.getActive()] and `is` [public boolean CLASS_NAME.isActive()] variant"},}

Environment

Windows 7 Pro (64-bit)
Java 8 u91 (64-bit)
Wildfly 10.0.0.Final

Assignee

Unassigned

Reporter

Patrick Bakker

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure