You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
879 B
31 lines
879 B
package db.model;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
import org.hibernate.criterion.DetachedCriteria;
|
|
import org.springframework.dao.DataAccessException;
|
|
|
|
import java.io.Serializable;
|
|
|
|
/**
|
|
* Created by reborn on 2017/8/3.
|
|
*/
|
|
|
|
public abstract class AbstractModel{
|
|
|
|
public abstract Serializable primaryKey();
|
|
|
|
public abstract String tableNote();
|
|
|
|
public DetachedCriteria getCriteria() {
|
|
return DetachedCriteria.forClass(this.getClass());
|
|
}
|
|
@SuppressWarnings("unchecked")
|
|
public <T extends AbstractModel> T cast() throws ClassCastException{
|
|
return (T) this;
|
|
}
|
|
}
|
|
|