@Entity(value = "projects") @Indexes({ @Index(value = "name") }) public class ProjectImpl extends BasicTaggableMongoBean implements IProject { @Id ObjectId id = new ObjectId(); /** * serialization */ public ProjectImpl(){ //NO-OP } public ObjectId getId(){ return this.id; } public void setId(String id){ this.id = new ObjectId(id); } @Override public String getIdAsString() { return getId().toString(); } }
@Entity(value = "elements") @Indexes({ @Index(value = "name") }) public class ElementImpl extends BasicEntityBean implements IElement{ public String type; public String locator; public String method; public int position; public ElementImpl() { this.type = ""; this.locator = ""; this.name = ""; this.method = ""; this.position = 0; } }
@Override @PrePersist public void prePersist() { // iteration++; }
public abstract class BasicEntityBean extends BasicTaggableMongoBean { @Id protected ObjectId id = new ObjectId(); public ObjectId getId() { return id; } public void setId(ObjectId id) { this.id = id; } }
@Entity(value = "elements", noClassnameStored = true) public class ElementImpl extends BasicEntityBean{ public String type; public String locator; public String method; public int position; public ElementImpl() { type = ""; locator = ""; name = ""; method = ""; position = 0; } }
public abstract class BasicTaggableMongoBean extends BasicMongoBean implements ITaggable { @Reference List<TagImpl> tags; public List<TagImpl> getTags() { return tags; } public void setTags(final List<TagImpl> tags) { this.tags = tags; } }
@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; } } }
@Override @PrePersist public void prePersist() { this.name = this.pageName; }
public abstract class BasicEntityBean extends BasicTaggableMongoBean { @Id protected ObjectId id = new ObjectId(); public ObjectId getId() { return id; } public void setId(final ObjectId id) { this.id = id; } public void setId(final String id) { this.id = id == null ? null: new ObjectId(id); } public String getIdAsString() { return id != null ? id.toString() : null; } }
public abstract class BasicTaggableMongoBean extends BasicMongoBean implements ITaggable { @Reference List<TagImpl> tags; public List<TagImpl> getTags() { return tags; } public void setTags(List<TagImpl> tags) { this.tags = tags; } }
@Override @PrePersist public void prePersist() { execDay = new Date(); iteration++; }
@PrePersist public void prePersist() { if(creationDate == null) { //in constructor ? creationDate = new Date(); } lastUpdated = new Date(); } }
@PrePersist public void prePersist() { if (creationDate == null) { creationDate = new Date(); } lastUpdated = new Date(); } }