Skip to content

Commit 9a5827e

Browse files
jimbogithubkoentsje
authored andcommitted
HBX-2614 - Check isNullable() in BasicPOJOClass::isRequiredInConstructor.
Restores previous Minimal Constructors behavior lost when isNullable() check removed from core org.hibernate.mapping.Property.isOptional().
1 parent e7b4889 commit 9a5827e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main/src/main/java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,9 @@ protected boolean isRequiredInConstructor(Property field) {
825825
return false;
826826
}
827827
if(field.getValue()!=null) {
828-
if (!field.isOptional() && (field.getValueGenerationStrategy() == null || field.getValueGenerationStrategy().getGenerationTiming().equals(GenerationTiming.NEVER))) {
828+
if (!(field.isOptional() || field.getValue().isNullable()) &&
829+
(field.getValueGenerationStrategy() == null ||
830+
field.getValueGenerationStrategy().getGenerationTiming().equals(GenerationTiming.NEVER))) {
829831
return true;
830832
} else if (field.getValue() instanceof Component) {
831833
Component c = (Component) field.getValue();

0 commit comments

Comments
 (0)