strangedb/src/main/java/org/warp/jcwdb/ann/DBObjectList.java

26 lines
634 B
Java

package org.warp.jcwdb.ann;
import java.io.IOException;
public class DBObjectList<T> extends DBList<T> {
public DBObjectList(JCWDatabase db, int maxLoadedItems) {
super(db, maxLoadedItems);
}
public DBObjectList(JCWDatabase database, DBObjectIndicesManager.DBObjectInfo objectInfo) throws IOException {
super(database, objectInfo);
}
@Override
protected T loadObjectFromDatabase(long uid) throws IOException {
return database.loadObject(uid);
}
@Override
protected long saveObjectToDatabase(long uid, T value) throws IOException {
database.writeObjectProperty(uid, DBDataType.OBJECT, value);
return uid;
}
}