PAN-48 Updated the AccountsDto and the AccountsRepository
This commit is contained in:
+5
-2
@@ -9,6 +9,7 @@ import javax.persistence.Entity;
|
|||||||
import javax.persistence.EntityListeners;
|
import javax.persistence.EntityListeners;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -19,10 +20,12 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class AccountsDto extends BaseDto implements Serializable {
|
public class AccountsDto extends BaseDto implements Serializable {
|
||||||
@Size(max = 50) private String username;
|
@NotBlank(groups = Insert.class, message = "A username must be specified") @Size(max = 50) private String username;
|
||||||
@Size(max = 256) private String password;
|
@NotBlank(groups = Insert.class, message = "A password must be specified") @Size(max = 256) private String password;
|
||||||
@NotNull @JsonProperty("administrator_status") private boolean administratorStatus;
|
@NotNull @JsonProperty("administrator_status") private boolean administratorStatus;
|
||||||
@Temporal(TemporalType.DATE) @JsonProperty("last_login") private Date lastLogin;
|
@Temporal(TemporalType.DATE) @JsonProperty("last_login") private Date lastLogin;
|
||||||
|
|
||||||
public static final long serialVersionUID = 7095627971593953734L;
|
public static final long serialVersionUID = 7095627971593953734L;
|
||||||
|
|
||||||
|
interface Insert {}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package edu.msudenver.tsp.persistence.repository;
|
package edu.msudenver.tsp.persistence.repository;
|
||||||
|
|
||||||
import edu.msudenver.tsp.persistence.dto.AccountsDto;
|
import edu.msudenver.tsp.persistence.dto.AccountsDto;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface AccountsRepository extends JpaRepository<AccountsDto, Integer> {
|
public interface AccountsRepository extends CrudRepository<AccountsDto, Integer> {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user