@@ -65,7 +65,7 @@ trait Associations {
65
65
66
66
def delete (): Option [T ] = companion.inTransaction {
67
67
val result = toOption
68
- result.foreach(_.delete)
68
+ result.foreach(_.delete() )
69
69
relation.cache = Nil
70
70
result
71
71
}
@@ -78,7 +78,7 @@ trait Associations {
78
78
79
79
def deleteAll (): List [T ] = companion.inTransaction {
80
80
val result = relation.toList
81
- result.foreach(_.delete)
81
+ result.foreach(_.delete() )
82
82
relation.cache = Nil
83
83
result
84
84
}
@@ -138,12 +138,12 @@ trait Associations {
138
138
val field = fieldInfo(foreignKey)
139
139
140
140
val r = source.where(conditionFactory(conditions)).where(
141
- m => field.toInExpression(m.getValue(foreignKey), ids)).toQuery.toList
141
+ m => field.toInExpression(m.getValue[ Any ] (foreignKey), ids)).toQuery.toList
142
142
r.groupBy(_.getOption[Any ](foreignKey).orNull)
143
143
}
144
144
145
145
def associate (m : T ): T = companion.inTransaction {
146
- if (hasConstraint) delete else remove
146
+ if (hasConstraint) delete() else remove()
147
147
if (m.isNewRecord) m.save(throws = true )
148
148
assignConditions(m).update
149
149
relation.cache = List (m)
@@ -199,7 +199,7 @@ trait Associations {
199
199
200
200
def associate (m : T ): I = companion.inTransaction {
201
201
if (m.isNewRecord) throw ActiveRecordException .recordMustBeSaved
202
- if (hasConstraint) delete else remove
202
+ if (hasConstraint) delete() else remove()
203
203
assignConditions(m).update
204
204
relation.cache = List (m)
205
205
val inter = through.build
@@ -227,8 +227,8 @@ trait Associations {
227
227
}
228
228
229
229
override def delete (): Option [T ] = companion.inTransaction {
230
- val result = super .delete
231
- if (hasConstraint) through.delete else remove
230
+ val result = super .delete()
231
+ if (hasConstraint) through.delete() else remove()
232
232
result
233
233
}
234
234
}
@@ -250,7 +250,7 @@ trait Associations {
250
250
val field = fieldInfo(foreignKey)
251
251
252
252
val r = source.where(conditionFactory(conditions)).where(
253
- m => field.toInExpression(m.getValue(foreignKey), ids)).toQuery.toList
253
+ m => field.toInExpression(m.getValue[ Any ] (foreignKey), ids)).toQuery.toList
254
254
r.groupBy(_.getOption[Any ](foreignKey).orNull)
255
255
}
256
256
@@ -272,7 +272,7 @@ trait Associations {
272
272
def ++= (list : Iterable [T ]): List [T ] = this << list
273
273
274
274
def := (list : Iterable [T ]): List [T ] = companion.inTransaction {
275
- if (hasConstraint) deleteAll else removeAll
275
+ if (hasConstraint) deleteAll() else removeAll()
276
276
relation.cache = list.toList.map(associate)
277
277
}
278
278
@@ -355,7 +355,7 @@ trait Associations {
355
355
def ++= (list : Iterable [T ]): List [I ] = this << list
356
356
357
357
def := (list : Iterable [T ]): List [I ] = companion.inTransaction {
358
- if (hasConstraint) deleteAll else removeAll
358
+ if (hasConstraint) deleteAll() else removeAll()
359
359
relation.cache = list.toList
360
360
relation.cache.map(associate)
361
361
}
@@ -393,8 +393,8 @@ trait Associations {
393
393
}
394
394
395
395
override def deleteAll (): List [T ] = companion.inTransaction {
396
- val result = super .deleteAll
397
- if (hasConstraint) through.deleteAll else removeAll
396
+ val result = super .deleteAll()
397
+ if (hasConstraint) through.deleteAll() else removeAll()
398
398
relation.cache = Nil
399
399
result
400
400
}
0 commit comments