public static < M extends Model > boolean isNew ( M m , String pk_column ) { final Object val = m . get ( pk_column ) ; return val == null || val instanceof Number && ( ( Number ) val ) . intValue ( ) <= 0 ; }
According to the primary key and entity determine whether for the new entity .