me.wuwenbin.modules.mongodb.pojo.MongoModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of template-modules-mongodb Show documentation
Show all versions of template-modules-mongodb Show documentation
提供对mongo数据源的高级操作,针对多数据源mongo和集群mongo
package me.wuwenbin.modules.mongodb.pojo;
import org.springframework.data.annotation.Id;
import java.util.UUID;
/**
* author: 伍文彬
* date: 2016年5月23日
* time: 下午12:04:20
* ClassName: ObjectModule
* Description: 所有的实体类都要继承此类,以来生成MongoDB的主键_id
* Version: Ver 1.0.0
*/
public class MongoModule {
@Id
public String _id;
public MongoModule() {
this.set_id(String.valueOf(UUID.randomUUID().toString().replace("-", "")));
}
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy