Skip to content

Commit ea3c40d

Browse files
committed
Fixed a problem that was preventing compilation with Scala 2.9.0-1
1 parent e628e97 commit ea3c40d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/scala/org/squeryl/internals/ArrayTEF.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import org.squeryl.Session
55
import org.squeryl.dsl.TypedExpressionFactory
66
import org.squeryl.dsl.ArrayJdbcMapper
77

8-
abstract class ArrayTEF[P, TE] extends TypedExpressionFactory[Array[P], TE] with ArrayJdbcMapper[java.sql.Array, Array[P]] {
9-
// must define "sample" that includes an element. e.g. Array[Int](0)
10-
def sample : Array[P]
8+
abstract class ArrayTEF[P, TE] extends TypedExpressionFactory[Array[P], TE] with ArrayJdbcMapper[java.sql.Array, Array[P]] {
9+
// must define "sample" that includes an element. e.g. Array[Int](0)
10+
def sample : Array[P]
1111
def toWrappedJDBCType(element: P) : java.lang.Object
1212
def fromWrappedJDBCType(element: Array[java.lang.Object]) : Array[P]
1313
val defaultColumnLength = 1
@@ -17,8 +17,9 @@ abstract class ArrayTEF[P, TE] extends TypedExpressionFactory[Array[P], TE] with
1717
val s = Session.currentSession
1818
val con = s.connection
1919
var rv: java.sql.Array = null
20-
try {
21-
val typ = s.databaseAdapter.arrayCreationType(sample(0).getClass)
20+
try {
21+
//asInstanceOf required for 2.9.0-1 to compile
22+
val typ = s.databaseAdapter.arrayCreationType(sample(0).asInstanceOf[{ def getClass : Class[_] }].getClass)
2223
rv = con.createArrayOf(typ, content)
2324
} catch {
2425
case e: Exception => s.log("Cannot create JDBC array: " + e.getMessage)
@@ -29,7 +30,7 @@ abstract class ArrayTEF[P, TE] extends TypedExpressionFactory[Array[P], TE] with
2930
val s = Session.currentSession
3031
var rv : Array[P] = sample.take(0)
3132
try {
32-
val obj = v.getArray();
33+
val obj = v.getArray();
3334
rv = fromWrappedJDBCType(obj.asInstanceOf[Array[java.lang.Object]])
3435
} catch {
3536
case e: Exception => s.log("Cannot obtain array from JDBC: " + e.getMessage)

0 commit comments

Comments
 (0)