[1.2.4] Why does this work in 1.2.3 but fails in 1.2.4 - @ElementCollection with nested @Embeddable
67 views
Skip to first unread message
chesrae
unread,
Jan 30, 2012, 7:35:05 PM1/30/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-framework
Consider the following three simplified classes
@Entity
public class Game extends Model {
@ElementCollection
public List<Interval> intervals;
}
@Embeddable
public class Interval {
@Embedded @AttributeOverride(name = "secondsElapsed", column =
@Column(name = "begin_seconds"))
public Instant begin;
@Embedded @AttributeOverride(name = "secondsElapsed", column =
@Column(name = "end_seconds"))
public Instant end;
}
@Embeddable
public class Instant {
public int secondsElapsed;
}
This code runs fine in 1.2.3 and produces the expected schema but
fails to load the application in 1.2.4.
I can certainly accept criticism that this is not the best design but
I am curious as to why it began to fail in 1.2.4
Any help would be greatly appreciated.
Stack Trace produced by 1.2.4:
Oops: ArrayIndexOutOfBoundsException
An unexpected error occured caused by exception
ArrayIndexOutOfBoundsException: 0
play.exceptions.UnexpectedException: Unexpected Error
at play.Play.start(Play.java:545)
at play.Play.detectChanges(Play.java:618)
at play.Invoker$Invocation.init(Invoker.java:198)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at
org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:
1735)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:
1711)
at
org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:
599)
at
org.hibernate.persister.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:
74)
at
org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:
104)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
307)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:
1842)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:
902)
at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:240)
at
play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:
480)
at play.Play.start(Play.java:515)