[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Comment: was deleted
(was: Seems that the answer to the last question is that the [https://github.com/wildfly/wildfly/blob/master/jpa/hibernate-transformer/...] check for Ljava/lang/Object is not going to match. Created [WFLY-11994] for addressing matching Ljava/lang/Object against any class.)
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Comment: was deleted
(was: The attached afterchange.zip is from running with:
./standalone.sh -DHibernate51CompatibilityTransformer=true -DHibernate51CompatibilityTransformer.showTransformedClassFolder=/tmp/outfolder -DHibernate51TransformSessImplMtds=true
Some of the differences to determine if they are correct in output for BooleanAbstractStandardBasicType extends org/hibernate/type/AbstractStandardBasicType:
beforechange:
{quote}
private static internalSessionImplementorUsingMethod(Lorg/hibernate/engine/spi/SessionImplementor;)V
...
INVOKESTATIC org/jboss/as/test/compat/jpa/hibernate/transformer/BooleanAbstractStandardBasicType.internalSessionImplementorUsingMethod (Lorg/hibernate/engine/spi/SessionImplementor;)V
...
public set(Ljava/sql/PreparedStatement;Ljava/lang/Boolean;ILorg/hibernate/engine/spi/SessionImplementor;)V throws org/hibernate/HibernateException java/sql/SQLException
{quote}
afterchange:
{quote}
private static internalSessionImplementorUsingMethod(Lorg/hibernate/engine/spi/SharedSessionContractImplementor;)V
...
INVOKESTATIC org/jboss/as/test/compat/jpa/hibernate/transformer/BooleanAbstractStandardBasicType.internalSessionImplementorUsingMethod (Lorg/hibernate/engine/spi/SharedSessionContractImplementor;)V
...
public set(Ljava/sql/PreparedStatement;Ljava/lang/Boolean;ILorg/hibernate/engine/spi/SharedSessionContractImplementor;)V throws org/hibernate/HibernateException java/sql/SQLException
{quote}
In question is whether the set() method should of been transformed.)
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Description:
The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
{code}
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
return internalNullSafeGet(rs, names, session, owner);
}
private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
internalSessionImplementorUsingMethod(session);
session.isTransactionInProgress();
int result = rs.getInt( names[0] );
if ( rs.wasNull() ) return null;
return State.values()[result];
}
}
{code}
was:
The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not.
{code}
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
return internalNullSafeGet(rs, names, session, owner);
}
private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
internalSessionImplementorUsingMethod(session);
session.isTransactionInProgress();
int result = rs.getInt( names[0] );
if ( rs.wasNull() ) return null;
return State.values()[result];
}
}
{code}
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Description:
The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not.
{code}
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
return internalNullSafeGet(rs, names, session, owner);
}
private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
internalSessionImplementorUsingMethod(session);
session.isTransactionInProgress();
int result = rs.getInt( names[0] );
if ( rs.wasNull() ) return null;
return State.values()[result];
}
}
{code}
was:
The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not.
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months