I have an entity class where I use Lombok, I need to how to exclude certain variables from Lombok @AllArgsConstructor annotation?
@Entity
@Table(name = "customer")
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "email")
private String email;
}
from the above code, I need to know how can I exclude 'id' from @AllArgsConstructor.
is there any other annotation which can be used to create a constructor by excluding some variables?
thanks in advance