Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record Builder with jakarta.validation.constraints #196

Open
fordsworth opened this issue Jan 11, 2025 · 0 comments
Open

Record Builder with jakarta.validation.constraints #196

fordsworth opened this issue Jan 11, 2025 · 0 comments

Comments

@fordsworth
Copy link

Given a record
@RecordBuilder
public record IdentityData(
Long id,
@NotNull IdentityType identityType,
@notempty String identityNumber
}

The builder generated has

@generated("io.soabase.recordbuilder.core.RecordBuilder")
public static IdentityData IdentityData(Long id, @NotNull IdentityType identityType,
@notempty String identityNumber ) {
return new IdentityData(id, identityType, identityNumber);
}

Static fields are excluded from validation in Jakarta Bean Validation. When using say a framework like Quarkus you get a warning 
 Hibernate Validator does not support constraints on static methods yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant