If an entity field with type java.util.Currency is created like this:
the automated tests fail because of the @NotNull constraint on this field:Code:project --topLevelPackage com.example --projectName example --java 6 jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity jpa --class com.example.AccountingTransaction --testAutomatically field other --fieldName currency --type java.util.Currency --notNull
This is because of the following generated implementation in aspect AccountingTransactionDataOnDemand_Roo_DataOnDemand :Code:testCountAccountingTransactions(com.example.AccountingTransactionIntegrationTest): [ConstraintDescriptorImpl{annotation=javax.validation.constraints.NotNull, payloads=[], hasComposingConstraints=true, isReportAsSingleInvalidConstraint=false, elementType=FIELD, definedOn=DEFINED_LOCALLY, groups=[interface javax.validation.groups.Default], attributes={message={javax.validation.constraints.NotNull.message}, payload=[Ljava.lang.Class;@3cd713fe, groups=[Ljava.lang.Class;@4c61a7e6}}:kann nicht null sein=null]
How can this be fixed properly without modifying the generated aspect myself?Code:public void AccountingTransactionDataOnDemand.setCurrency(AccountingTransaction obj, int index) { Currency currency = null; obj.setCurrency(currency); }


Reply With Quote
