본문 바로가기
문제&해결

[문제] @Valid, @Column(nullable=false) 안됨

by moonstal 2022. 4. 7.

오늘 두번째 문제는 분명 not null로 테이블 생성 됐는데 아무것도 안넣어도 회원가입이 된다.

@Column(nullable=false, length =50, unique=true)에서 유니크는 잘 동작한다.

null과 ''는 다르다.

그냥 잘 동작하고 있는 거였다.

https://stackoverflow.com/questions/25741437/columnnullable-false-not-working

근데 @Valid에서 @NotBlank는 다 막아줘야되는데 

https://kafcamus.tistory.com/15

 

[JPA] nullable=false와 @NotNull 비교, Hibernate Validation

오늘은 다음의 고민 때문에 글을 작성하게 되었다. JPA에서 DDL을 자동으로 생성할 수 있는데, 이 때 not null 옵션은 어떻게 붙이나? JPA의 엔티티 객체에 @NotNull 검증 어노테이션을 주면 어떻게 되나

kafcamus.tistory.com

input type="email" 이건 왜 또 작동안할까

버튼타입이 submit일때만 작동