Use @Column instead of @NotNull
This commit is contained in:
parent
dd80bfe4c6
commit
321630053d
@ -2,10 +2,10 @@ package dst.ass1.jpa.model.impl;
|
|||||||
|
|
||||||
import dst.ass1.jpa.model.IPlatformUser;
|
import dst.ass1.jpa.model.IPlatformUser;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.MappedSuperclass;
|
import javax.persistence.MappedSuperclass;
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@ -15,7 +15,7 @@ public class PlatformUser implements IPlatformUser, Serializable {
|
|||||||
|
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
@NotNull
|
@Column(nullable = false)
|
||||||
protected String tel;
|
protected String tel;
|
||||||
|
|
||||||
protected Double avgRating;
|
protected Double avgRating;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import static dst.ass1.jpa.util.Constants.*;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(uniqueConstraints = @UniqueConstraint(columnNames = {M_RIDER_ACCOUNT, M_RIDER_BANK_CODE}))
|
@Table(uniqueConstraints = @UniqueConstraint(columnNames = {M_RIDER_ACCOUNT, M_RIDER_BANK_CODE}))
|
||||||
public class Rider extends PlatformUser implements IRider {
|
public class Rider extends PlatformUser implements IRider {
|
||||||
@Column(unique = true) @NotNull
|
@Column(unique = true, nullable = false)
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@Column(columnDefinition = "VARBINARY(20)", length = 20)
|
@Column(columnDefinition = "VARBINARY(20)", length = 20)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user