有人可以给我一个用morphia和mongodb进行映射的代码示例吗? 这是我的班,其中包含数据库字段。我不知道如何 使吗啡和mongodb之间的联系。如何从mogodb创建类
import com.google.code.morphia.annotations.*;
//@Entity
//define the name of the collection where this entity will be stored
@Entity("tabes")
class MappingMorphia {
@Id
String id;
String FACILITY;
String HOST;
String MESSAGE;
String PID;
String PRIORITY;
String PROGRAM;
int SEQNUM;
String SOURCE;
String SOURCEIP;
String TAGS;
//getters and setters
}
他用吗啡(或试图),使对象模型的工作就好了。 – evanchooly
在这里,有我的喜欢 – lascort