[CORDA-1468] Properly handle entites where NULLs can be inserted into DB (#3324)

* Allow proper null values on entities which fields can get NULL values.
This commit is contained in:
Maksymilian Pawlak
2018-06-11 13:12:19 +01:00
committed by GitHub
parent 1aa1189b36
commit c009cbd91a
17 changed files with 40 additions and 40 deletions

View File

@ -44,13 +44,13 @@ sealed class SecureHash(bytes: ByteArray) : OpaqueBytes(bytes) {
* @throws IllegalArgumentException The input string does not contain 64 hexadecimal digits, or it contains incorrectly-encoded characters.
*/
@JvmStatic
fun parse(str: String): SHA256 {
return str.toUpperCase().parseAsHex().let {
fun parse(str: String?): SHA256 {
return str?.toUpperCase()?.parseAsHex()?.let {
when (it.size) {
32 -> SHA256(it)
else -> throw IllegalArgumentException("Provided string is ${it.size} bytes not 32 bytes in hex: $str")
}
}
} ?: throw IllegalArgumentException("Provided string is null")
}
/**

View File

@ -49,7 +49,7 @@ object CommonSchemaV1 : MappedSchema(schemaFamily = CommonSchema.javaClass, vers
/** X500Name of participant parties **/
@Transient
open var participants: MutableSet<AbstractParty>? = null,
open var participants: MutableSet<AbstractParty?>? = null,
/** [OwnableState] attributes */