@@ -32,11 +32,14 @@ class TransientEntitiesUpdaterImpl(
32
32
override fun compareTo (other : Any ): Int {
33
33
return - 1
34
34
}
35
+
36
+ override fun toString () = " Empty Binary Data"
35
37
}
36
38
val NOT_NULL_BLOB = object : Comparable <Any > {
37
39
override fun compareTo (other : Any ): Int {
38
40
return - 1
39
41
}
42
+ override fun toString () = " Binary Data"
40
43
}
41
44
}
42
45
@@ -49,16 +52,20 @@ class TransientEntitiesUpdaterImpl(
49
52
50
53
override fun setBlob (transientEntity : TransientEntity , blobName : String , stream : InputStream ) {
51
54
addChangeAndRun {
55
+ // this may be implemented another way. by checking if the blob is actually null
56
+ val hasBlob = transientEntity.blobNames.contains(blobName)
52
57
transientEntity.entity.setBlob(blobName, stream)
53
- transientChangesTracker.propertyChanged(transientEntity, blobName, NOT_NULL_BLOB )
58
+ transientChangesTracker.propertyChanged(transientEntity, blobName, if (hasBlob) NOT_NULL_BLOB else NULL_BLOB )
54
59
true
55
60
}
56
61
}
57
62
58
63
override fun setBlob (transientEntity : TransientEntity , blobName : String , file : File ) {
59
64
addChangeAndRun {
65
+ // this may be implemented another way. by checking if the blob is actually null
66
+ val hasBlob = transientEntity.blobNames.contains(blobName)
60
67
transientEntity.entity.setBlob(blobName, file)
61
- transientChangesTracker.propertyChanged(transientEntity, blobName, NOT_NULL_BLOB )
68
+ transientChangesTracker.propertyChanged(transientEntity, blobName, if (hasBlob) NOT_NULL_BLOB else NULL_BLOB )
62
69
true
63
70
}
64
71
}
0 commit comments