root.java

来自「这个是perst-269.zip下面的SOURCECODE,和大家分享了。」· Java 代码 · 共 28 行

JAVA
28
字号
import org.garret.perst.*;

public class Root extends Persistent { 
    Index teamId;
    Index teamName;
    Index playerLName;

    public void readObject(IInputStream in) { 
        teamId = (Index)in.readObject();
        teamName = (Index)in.readObject();
        playerLName = (Index)in.readObject();
    }

    public void writeObject(IOutputStream out) { 
        out.writeObject(teamId);
        out.writeObject(teamName);
        out.writeObject(playerLName);
    }

    public Root() {}

    public Root(Storage db) { 
        super(db);
        teamId = db.createIndex(Types.Int, true);
        teamName = db.createIndex(Types.String, true);
        playerLName = db.createIndex(Types.String, false);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?