[hibernate-dev] ORM 4.2.8.Final breaks the EntityKey API and thus HSearch

Steve Ebersole steve at hibernate.org
Thu Dec 5 11:19:17 EST 2013


Can't (read you should be!)  you use 
org.hibernate.engine.spi.SessionImplementor#generateEntityKey ?

Its signature hides the values from Session actually kept on the 
genernated EntityKey:

public EntityKey generateEntityKey(Serializable id, EntityPersister 
persister);

That signature has not changed.

On 12/05/2013 09:51 AM, Guillaume Smet wrote:
> Hi all,
>
> ORM 4.2.8.Final breaks the API of EntityKey as it removes tenantId
> from the constructor.
>
> Typically, in HSearch, we have the following call:
> https://github.com/hibernate/hibernate-search/blob/master/orm/src/main/java/org/hibernate/search/query/hibernate/impl/PersistenceContextObjectsInitializer.java#L74
>
> As 4.2.8.Final removes the tenantId from the EntityKey constructor,
> you get a nice:
> java.lang.NoSuchMethodError:
> org.hibernate.engine.spi.EntityKey.<init>(Ljava/io/Serializable;Lorg/hibernate/persister/entity/EntityPersister;Ljava/lang/String;)V
>      at org.hibernate.search.query.hibernate.impl.PersistenceContextObjectsInitializer.initializeObjects(PersistenceContextObjectsInitializer.java:73)
>
> >From my point of view, the best way to go would be to reintroduce the
> constructor in EntityKey, mark it as deprecated and ignore the
> tenantId.
>
> I think it's worth a respin and a 4.2.8.SP1.
>
> Thoughts?
>
> (btw, totally unrelated, it would be nice to have examples of the new
> Maven plugin for bytecode enhancement).
>



More information about the hibernate-dev mailing list