Mercurial > hg > Members > nobuyasu > TOModel
view app/controllers/Application.java @ 3:5a097a2336fa draft
commit
author | e085711 |
---|---|
date | Wed, 26 Sep 2012 14:43:07 +0900 |
parents | e45bf6020b0d |
children |
line wrap: on
line source
package controllers; import play.*; import play.mvc.*; import java.util.*; import models.TPGraph; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; public class Application extends Controller { public static void index() { render(); } public static void testwrite() { TPGraph tpgraph = TPGraph.getInstance(); Graph graph = tpgraph.getGraph(); Vertex a = graph.addVertex(null); a.setProperty("name","mario"); Object id = a.getId(); tpgraph.shutdownGraph(); graph.shutdown(); renderText(id); } public static void testread() { TPGraph tpgraph = TPGraph.getInstance(); Graph graph = tpgraph.getGraph(); Vertex a = graph.getVertex(0); String str = (String) a.getProperty("name"); renderText(str); } }