private Record setDefault ( Record record ) { int size = record . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) if ( record . get ( i ) == null ) { @ SuppressWarnings ( "unchecked" ) Field < Object > field = ( Field < Object > ) record . field ( i ) ; if ( ! field . getDataType ( ) . nullable ( ) && ! field . getDataType ( ) . identity ( ) ) record . set ( field , DSL . defaultValue ( ) ) ; } return record ; }
Defaults fields that have a default value and are nullable .