@PreLoad void preLoad(DBObject raw) { rawResults = raw; }
/** * Used to store counters for other entities. * @author skot * */ @Entity(value="ids", noClassnameStored=true) public static class StoredId { final @Id String className; protected Long value = 1L; public StoredId(String name) { className = name; } protected StoredId(){ className = ""; } public Long getValue() { return value; } } }
/** * User: wuoti * Date: 2.5.2013 * Time: 13.29 */ @Embedded("Hakutoive") public class Hakutoive { private String hakukohdeOid; @Embedded private List<ValinnanVaihe> valinnanVaiheet = new ArrayList<ValinnanVaihe>(); public String getHakukohdeOid() { return hakukohdeOid; } public void setHakukohdeOid(String hakukohdeOid) { this.hakukohdeOid = hakukohdeOid; } public List<ValinnanVaihe> getValinnanVaiheet() { return valinnanVaiheet; } public void setValinnanVaiheet(List<ValinnanVaihe> valinnanVaiheet) { this.valinnanVaiheet = valinnanVaiheet; } }
private void processClassAnnotations(final MappedClass mc, final boolean background) { //Ensure indexes from class annotation final List<Annotation> indexes = mc.getAnnotations(Indexes.class); if (indexes != null) { for (final Annotation ann : indexes) { final Indexes idx = (Indexes) ann; if (idx != null && idx.value() != null && idx.value().length > 0) { for (final Index index : idx.value()) { final BasicDBObject fields = QueryImpl.parseFieldsString(index.value(), mc.getClazz(), mapper, !index.disableValidation()); ensureIndex(mc.getClazz(), index.name(), fields, index.unique(), index.dropDups(), index.background() ? index.background() : background, index.sparse(), index.expireAfterSeconds()); } } } } }
public Class getConcreteType() { final Embedded e = getAnnotation(Embedded.class); if (e != null) { final Class concrete = e.concreteClass(); if (concrete != Object.class) { return concrete; } } final Property p = getAnnotation(Property.class); if (p != null) { final Class concrete = p.concreteClass(); if (concrete != Object.class) { return concrete; } } return getType(); } }
@PrePersist private void prePersist() { if (createdAt == null) { createdAt = new Date(); } } }
private Stats counts = new Stats(); @Property("result") private String outColl; private long timeMillis;
/** * Used to store counters for other entities. * * @author skot */ @Entity(value = "ids", noClassnameStored = true) public static class StoredId { @Id final String className; protected final Long value = 1L; public StoredId(final String name) { className = name; } protected StoredId() { className = ""; } public Long getValue() { return value; } } }
public Class getConcreteType() { Embedded e = getAnnotation(Embedded.class); if (e != null) { Class concrete = e.concreteClass(); if (concrete != Object.class) { return concrete; } } Property p = getAnnotation(Property.class); if (p != null) { Class concrete = p.concreteClass(); if (concrete != Object.class) { return concrete; } } return getType(); } }
@PrePersist private void prePersist() { if (createdAt == null) { createdAt = new Date(); } } }
public class NestedEntity { @Property(value = "nestedClassName") private String name; private String nestedClassDescription; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getNestedClassDescription() { return nestedClassDescription; } public void setNestedClassDescription(String nestedClassDescription) { this.nestedClassDescription = nestedClassDescription; } }
@Embedded public class Valintakoe { private String valintakoeOid;
@PreLoad void preLoad(final DBObject raw) { rawResults = raw; }
/** * User: tommiha * Date: 8/7/13 * Time: 1:08 PM */ @Entity("JonosijaHistoria") public class JonosijaHistoria { @Id private ObjectId id; private String historia; public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } public String getHistoria() { return historia; } public void setHistoria(String historia) { this.historia = historia; } }
@PrePersist private void prePersist() { createdAt = new Date(); }