标签:hash equals htm 1.0 new oid tor eve ref
<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../bin/ehcache.xsd"> <defaultCache overflowToDisk="true" eternal="false" maxElementsInMemory="1"/> <diskStore path="E:/cache" /> </ehcache>
备注:diskStore 路径需要修改成对应的磁盘位置或目录
<cache type="org.mybatis.caches.ehcache.EhcacheCache" />
<?xml version="1.0" encoding="UTF-8" ?> <configuration debug="false"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="STDOUT"/> </root> <logger name="org" level="error" /> </configuration>
package com.sishuok.architecture1.common.vo; import com.sishuok.pageutil.Page; public class BaseModel implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; private Integer uuid; private Page page = new Page(); public Page getPage() { return page; } public void setPage(Page page) { this.page = page; } public Integer getUuid() { return uuid; } public void setUuid(Integer uuid) { this.uuid = uuid; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BaseModel other = (BaseModel) obj; if (uuid == null) { if (other.uuid != null) return false; } else if (!uuid.equals(other.uuid)) return false; return true; } }
备注:所有的model都继承了BaseModel,因此只需要BaseModel实现序列化就可以了,参考以上代码
标签:hash equals htm 1.0 new oid tor eve ref
原文地址:https://www.cnblogs.com/likevin/p/10242389.html