strangedb/src/main/java/org/warp/jcwdb/ann/exampleimpl/SingleClass.java

69 lines
1.6 KiB
Java

package org.warp.jcwdb.ann.exampleimpl;
import org.warp.jcwdb.ann.*;
import java.io.IOException;
import java.util.StringJoiner;
public class SingleClass extends DBObject {
@DBField(id = 0, type = DBDataType.INTEGER)
public int valueInt;
@DBField(id = 1, type = DBDataType.OBJECT)
public String valueObj;
@DBField(id = 2, type = DBDataType.DATABASE_OBJECT)
public IntClass valueDB;
@DBPropertySetter(id = 0, type = DBDataType.INTEGER)
public void setInt(int value) {
setProperty(value);
}
@DBPropertySetter(id = 1, type = DBDataType.OBJECT)
public void setObj(String value) {
setProperty(value);
}
@DBPropertySetter(id = 2, type = DBDataType.DATABASE_OBJECT)
public void setDB(IntClass value) {
setProperty(value);
}
@DBPropertyGetter(id = 0, type = DBDataType.INTEGER)
public int getInt() {
return getProperty();
}
@DBPropertyGetter(id = 1, type = DBDataType.OBJECT)
public String getObj() {
return getProperty();
}
@DBPropertyGetter(id = 2, type = DBDataType.DATABASE_OBJECT)
public IntClass getDB() {
return getProperty();
}
public SingleClass(JCWDatabase database) {
super(database);
}
public SingleClass(JCWDatabase database, DBObjectIndicesManager.DBObjectInfo objectInfo) throws IOException {
super(database, objectInfo);
}
@Override
public String toString() {
return new StringJoiner(", ", SingleClass.class.getSimpleName() + "[", "]")
.add("valueInt=" + valueInt)
.add("valueObj='" + valueObj + "'")
.add("valueDB=" + valueDB)
.add("getInt=" + getInt())
.add("getObj='" + getObj() + "'")
.add("getDB=" + getDB())
.toString();
}
}