I am using interface projection . For unit testing purpose i have to add both getter and setter. In Jpa query i have a Boolean parameter named isPublic. But getter setter not working. i tried following
Boolean isPublic();
void setPublic(Boolean isPublic);
and this
Boolean getIsPublic();
void setIsPublic(Boolean isPublic);
and this
Boolean getPublic();
void setPublic(Boolean isPublic);
But everything works when i change variable name to public with setter setPublic and getter getPublic. How do i properly set getter setter for isPublic?
If your variable name is "isPublic", then, your getter should be named isIsPublic.
The "is" shouldn't be in the variable name.
import org.springframework.beans.factory.annotation.Value;
public interface MyClass {
@Value("#{target.value == 1}")
Boolean getValue();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With