spring boot/snippets

jpa entity에서 column 정의

lingi04 2021. 12. 22. 23:11
@Entity
@Table(name = "tb_item")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Item extends BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    Long id;

    @Column(columnDefinition = "VARCHAR", length = 10)
    private String str;
}