本文整理了Java中org.mongodb.morphia.annotations.Entity
类的一些代码示例,展示了Entity
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity
类的具体详情如下:
包路径:org.mongodb.morphia.annotations.Entity
类名称:Entity
暂无
代码示例来源:origin: jooby-project/jooby
@Entity(value= "idgen", noClassnameStored = true)
public class StoredId {
@Id
final String className;
final Long value = 1L;
public StoredId(final String name) {
className = name;
}
protected StoredId() {
className = "";
}
}
代码示例来源:origin: org.mongodb.morphia/morphia
/**
* @return the collName
*/
public String getCollectionName() {
if (entityAn == null || entityAn.value().equals(Mapper.IGNORED_FIELDNAME)) {
return mapperOptions.isUseLowerCaseCollectionNames() ? clazz.getSimpleName().toLowerCase() : clazz.getSimpleName();
}
return entityAn.value();
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public void ensureCaps() {
for (final MappedClass mc : mapper.getMappedClasses()) {
if (mc.getEntityAnnotation() != null && mc.getEntityAnnotation().cap().value() > 0) {
final CappedAt cap = mc.getEntityAnnotation().cap();
final String collName = mapper.getCollectionName(mc.getClazz());
final BasicDBObjectBuilder dbCapOpts = start("capped", true);
if (cap.value() > 0) {
dbCapOpts.add("size", cap.value());
}
if (cap.count() > 0) {
dbCapOpts.add("max", cap.count());
}
final DB database = getDB();
if (database.getCollectionNames().contains(collName)) {
final DBObject dbResult = database.command(start("collstats", collName).get());
if (dbResult.containsField("capped")) {
LOG.debug("DBCollection already exists and is capped already; doing nothing. " + dbResult);
} else {
LOG.warning("DBCollection already exists with same name(" + collName
+ ") and is not capped; not creating capped version!");
}
} else {
getDB().createCollection(collName, dbCapOpts.get());
LOG.debug("Created capped DBCollection (" + collName + ") with opts " + dbCapOpts);
}
}
}
}
代码示例来源:origin: jzyong/game-server
/**
* 是否包含加载表
*
* @author JiangZhiYong
* @QQ 359135103 2017年10月18日 下午4:15:17
* @param tables
* @param clazz
* @return
*/
default boolean containTable(List<String> tables, Class<?> clazz) {
if (tables == null || tables.isEmpty()) {
return true;
}
Entity entity = clazz.getAnnotation(Entity.class);
if (entity != null && tables.contains(entity.value())) {
return true;
}
return false;
}
}
代码示例来源:origin: jzyong/game-server
/**
* 排行榜信息
* @author JiangZhiYong
* @QQ 359135103
* 2017年9月30日 下午6:06:27
*/
@Entity(value="rank",noClassnameStored=true)
public class Rank {
}
代码示例来源:origin: acmeair/acmeair
@Entity(value="airportCodeMapping")
public class AirportCodeMappingImpl implements AirportCodeMapping, Serializable{
代码示例来源:origin: garystafford/virtual-vehicles-demo
@Entity("clients")
public class Client
extends AbstractMongodbEntity
代码示例来源:origin: acmeair/acmeair
@Entity(value="flightSegment")
public class FlightSegmentImpl implements FlightSegment, Serializable{
代码示例来源:origin: acmeair/acmeair
@Entity(value="customerSession")
public class CustomerSessionImpl implements CustomerSession, Serializable {
代码示例来源:origin: garystafford/virtual-vehicles-demo
@Entity("records")
public class Record
extends AbstractMongodbEntity
代码示例来源:origin: org.actframework/act-morphia
@Entity("_act_seq")
@SuppressWarnings("unused")
static class Sequence {
@Id
private String _id;
private long number;
}
代码示例来源:origin: org.jooby/jooby-morphia
@Entity(value= "idgen", noClassnameStored = true)
public class StoredId {
@Id
final String className;
final Long value = 1L;
public StoredId(final String name) {
className = name;
}
protected StoredId() {
className = "";
}
}
代码示例来源:origin: garystafford/virtual-vehicles-demo
@Entity("transactions")
public class Transaction
extends AbstractMongodbEntity
代码示例来源:origin: groupon/DotCi
@Entity("build_number_counter")
public class BuildNumberCounter {
@Id
private ObjectId id = new ObjectId();
private String key;
private int counter;
public BuildNumberCounter(String key, int counter) {
this.key = key;
this.counter = counter;
}
public int getCounter() {
return counter;
}
}
代码示例来源:origin: acmeair/acmeair
@Entity(value="customer")
public class CustomerImpl implements Customer, Serializable{
代码示例来源:origin: garystafford/virtual-vehicles-demo
@Entity("vehicles")
public class Vehicle
extends AbstractMongodbEntity
代码示例来源:origin: jzyong/game-server
/**
* 房间配置
* @author JiangZhiYong
* @QQ 359135103
* 2017年10月19日 上午11:42:31
*/
@Entity(value="c_room",noClassnameStored=true)
public class CRoom implements IConfigChecker {
@Id
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
代码示例来源:origin: getheimdall/heimdall
/**
* This class represents a log trace of the requests that are saved to the MongoDB
*
* @author Marcelo Rodrigues
*/
@Entity(noClassnameStored=true, value="logs")
@Data
public class LogTrace implements Serializable {
private static final long serialVersionUID = -3756531883939035456L;
@Id
private ObjectId id;
private Trace trace;
private String logger;
private String level;
private String thread;
private Date ts;
}
代码示例来源:origin: lievendoclo/cleanarch
@Entity
public class TenantDocument {
@Id
private String id;
private String name;
protected TenantDocument() {}
public TenantDocument(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
}
代码示例来源:origin: NationalSecurityAgency/lemongrenade
@Entity(value = "adapterURLs", noClassnameStored = true)
内容来源于网络,如有侵权,请联系作者删除!