Commit b6244184 by Jan Hrabal

errors

parent c9746623
......@@ -12,6 +12,8 @@ import java.util.stream.Collectors;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
......@@ -31,6 +33,7 @@ import com.jh.boot.jpa.AbstractIdEntity;
*/
@Entity
@Table(name = "APP_USER")
@Inheritance(strategy = InheritanceType.JOINED)
public class AppUser extends AbstractIdEntity {
private static final long serialVersionUID = 1L;
......
package com.jh.boot.web.error;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* The Class ErrorMessage.
*/
public class ErrorMessage {
/** The field. */
private String field;
/** The code. */
private String code;
/** The message. */
@JsonProperty("msg")
private String message;
/**
* Instantiates a new error message.
*/
private ErrorMessage() {
}
/* builder methods */
/**
* Constructs error message with field, code and message .
*
* @param field the field
* @param code the code
* @param message the message
* @return the error message
*/
public static ErrorMessage withFieldCodeMessage(String field, String code, String message) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
em.message = message;
return em;
}
/**
* Constructs error message with field, code and message .
*
* @param field the field
* @param message the message
* @return the error message
*/
public static ErrorMessage withFieldMessage(String field, String message) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.message = message;
return em;
}
/**
* Constructs error message with field and code .
*
* @param field the field
* @param code the code
* @return the error message
*/
public static ErrorMessage withFieldCode(String field, String code) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
return em;
}
/**
* Constructs error message with code and message .
*
* @param code the code
* @param message the message
* @return the error message
*/
public static ErrorMessage withCodeMessage(String code, String message) {
ErrorMessage em = new ErrorMessage();
em.code = code;
em.message = message;
return em;
}
/**
* With message.
*
* @param message the message
* @return the error message
*/
public static ErrorMessage withMessage(String message) {
ErrorMessage em = new ErrorMessage();
em.message = message;
return em;
}
/**
* With code.
*
* @param code the code
* @return the error message
*/
public static ErrorMessage withCode(String code) {
ErrorMessage em = new ErrorMessage();
em.code = code;
return em;
}
/* getters */
/**
* Gets the field.
*
* @return the field
*/
public String getField() {
return field;
}
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Gets the message.
*
* @return the message
*/
public String getMessage() {
return message;
}
package com.jh.boot.web.error;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* The Class ErrorMessage.
*/
public class ErrorMessage {
public static final String CODE_VALUE_REQUIRED = "VALUE_REQUIRED";
/** The field. */
private String field;
/** The code. */
private String code;
/** The message. */
@JsonProperty("msg")
private String message;
/**
* Instantiates a new error message.
*/
private ErrorMessage() {
}
/* builder methods */
/**
* Constructs error message with field, code and message .
*
* @param field the field
* @param code the code
* @param message the message
* @return the error message
*/
public static ErrorMessage withFieldCodeMessage(String field, String code, String message) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
em.message = message;
return em;
}
/**
* Constructs error message with field, code and message .
*
* @param field the field
* @param message the message
* @return the error message
*/
public static ErrorMessage withFieldMessage(String field, String message) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.message = message;
return em;
}
/**
* Constructs error message with field and code .
*
* @param field the field
* @param code the code
* @return the error message
*/
public static ErrorMessage withFieldCode(String field, String code) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
return em;
}
/**
* Constructs error message with code and message .
*
* @param code the code
* @param message the message
* @return the error message
*/
public static ErrorMessage withCodeMessage(String code, String message) {
ErrorMessage em = new ErrorMessage();
em.code = code;
em.message = message;
return em;
}
/**
* With message.
*
* @param message the message
* @return the error message
*/
public static ErrorMessage withMessage(String message) {
ErrorMessage em = new ErrorMessage();
em.message = message;
return em;
}
/**
* With code.
*
* @param code the code
* @return the error message
*/
public static ErrorMessage withCode(String code) {
ErrorMessage em = new ErrorMessage();
em.code = code;
return em;
}
/* getters */
/**
* Gets the field.
*
* @return the field
*/
public String getField() {
return field;
}
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Gets the message.
*
* @return the message
*/
public String getMessage() {
return message;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment