IndexOutOfBoundsException when executing lookup function on KeyedEntity with CompositeKey
Given a class like this
Attempting to execute the following code will result in an ArrayIndexOutOfBoundsException
Here is the tail end of a typical stack trace.
class Foo(val f1: Int, val f2: Int) extends KeyedEntity[CompositeKey2[Int, Int]] {
val id = compositeKey(f1, f2)
}
Attempting to execute the following code will result in an ArrayIndexOutOfBoundsException
foos.lookup(compositeKey(1, 1))
Here is the tail end of a typical stack trace.
org.specs.runner.UserError: java.lang.IndexOutOfBoundsException: 1
at scala.collection.mutable.ResizableArray$class.apply(ResizableArray.scala:45)
at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:43)
at scala.collection.mutable.ArrayBuffer.remove(ArrayBuffer.scala:158)
at org.squeryl.dsl.CompositeKey$class.buildEquality(CompositeKey.scala:56)
at org.squeryl.dsl.CompositeKey2.buildEquality(CompositeKey.scala:66)
at org.squeryl.internals.FieldReferenceLinker$.createEqualityExpressionWithLastAccessedFieldReferenceAndConstant(FieldReferenceLinker.scala:168)
Leave a comment
on 2011-02-24 05:58 *
By maxime.levesque
There is this test in the test sute :
https://github.com/max-l/Squeryl/blob/master/src/test/scala/org/squeryl/tests/schooldb2/SchoolDb2.scala#L331
that does not reproduce your problem.
Could you send a test case ?
https://github.com/max-l/Squeryl/blob/master/src/test/scala/org/squeryl/tests/schooldb2/SchoolDb2.scala#L331
that does not reproduce your problem.
Could you send a test case ?