Skip to content

org.springframework.data.annotation.Transient annotation doesn't work #1147

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

Closed
pradeesh-kumar opened this issue Jun 6, 2021 · 1 comment
Closed
Labels
type: bug A general bug

Comments

@pradeesh-kumar
Copy link

I'm trying to ignore a field from being persisted in the couchbase DB using spring data @transient annotation on the field. However, it doesn't work.

`
package com.example;

import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.springframework.data.annotation.Transient;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;

@DaTa
@NoArgsConstructor
@AllArgsConstructor
@builder(toBuilder = true)
public class Person {

@NotNull(message = "Name cannot be null")
private String firstName;
@NotBlank(message = "Last name cannot be blank")
private String lastName;

@Transient
private List<Work> works;

}
`

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 6, 2021
@mikereiche
Copy link
Collaborator

I put a fix for this in #963.

@mikereiche mikereiche added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 10, 2021
mikereiche added a commit that referenced this issue Aug 11, 2021
mikereiche added a commit that referenced this issue Aug 11, 2021
Closes #1147.

Co-authored-by: mikereiche <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants