We're updating the issue view to help you get more done. 

Simple @Generated(ALWAYS) doesn't work anymore

Description

Works in beta5, broken since CR1:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 @Entity public class Item { @Id @GeneratedValue(generator = Constants.ID_GENERATOR) public Long id; @org.hibernate.annotations.Generated( org.hibernate.annotations.GenerationTime.ALWAYS ) public Date lastModified; public String name; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 at java.lang.String.substring(String.java:1875) at org.hibernate.persister.entity.AbstractEntityPersister.generateGeneratedValuesSelectString(AbstractEntityPersister.java:1723) at org.hibernate.persister.entity.AbstractEntityPersister.generateInsertGeneratedValuesSelectString(AbstractEntityPersister.java:1692) at org.hibernate.persister.entity.AbstractEntityPersister.doLateInit(AbstractEntityPersister.java:3989) at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:4009) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:479) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:399) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:73) ... 36 more

Environment

None

Status

Assignee

Brett Meyer

Reporter

Christian Bauer

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.3.0.CR2

Priority

Critical