package org.warp.jcwdb.ann.exampleimpl; import org.warp.jcwdb.ann.*; import java.io.IOError; import java.io.IOException; import java.util.StringJoiner; public class ClassWithList extends DBObject { public ClassWithList(JCWDatabase database) { super(database); } public ClassWithList(JCWDatabase database, DBObjectIndicesManager.DBObjectInfo objectInfo) throws IOException { super(database, objectInfo); } @DBField(id = 0, type = DBDataType.DATABASE_OBJECT) public DBDBObjectList valueList; @DBPropertySetter(id = 0, type = DBDataType.DATABASE_OBJECT) public void setList(DBDBObjectList value) { setProperty(value); } @DBPropertyGetter(id = 0, type = DBDataType.DATABASE_OBJECT) public DBDBObjectList getList() { return getProperty(); } @Override public String toString() { DBDBObjectList list; boolean listErrored = false; try { list = getList(); } catch (IOError | Exception ex) { list = null; listErrored = true; } return new StringJoiner(", ", ClassWithList.class.getSimpleName() + "[", "]") .add("valueList=" + valueList) .add("getList=" + (listErrored ? "{error}" : (list == null ? list : list.size() < 100 ? list : "[" + list.size() + " items])"))) .toString(); } }