Package datomic

Examples of datomic.Database


    }
   
    @RequestMapping(value = "/database/{dbname}/search", method = GET)
    public ModelAndView search(@PathVariable String dbname, @RequestParam String terms) {
        final Connection connection = connect(dbname);
        final Database db = connection.db();
        final Collection<List<Object>> results =
            Peer.q("[:find ?o ?c :in $ % ?t :where (ft ?o ?c ?t)]",
                connection.db(),
                Rules.universalFullTextRule(connection.db()),
                terms);
        final List<Entity> entities = Lists.newArrayListWithCapacity(results.size());
        for (List<Object> result : results) {
            entities.add(db.entity(result.get(0)));
        }
        return new ModelAndView("search")
            .addObject("dbname", dbname)
            .addObject("uri", toUri(dbname))
            .addObject("terms", terms)
View Full Code Here


        }
        if (query == null) {
            throw runtime.newArgumentError("The first arg should be a query string or array");
        }
        //System.out.println("query: " + query.toString());
        Database database = DiametricPeer.getDatabase(args[1]);
        if (database == null) {
            throw runtime.newArgumentError("The second arg should be a database.");
        }

        Collection<List<Object>> results = null;
View Full Code Here

    @JRubyMethod
    public IRubyObject as_of(ThreadContext context, IRubyObject arg) {
        Object t_value = DiametricUtils.convertRubyToJava(context, arg);
        try {
            Database db_asof_t = (Database) DiametricService.getFn("datomic.api", "as-of").invoke(database, t_value);
            RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Database");
            DiametricDatabase diametric_database = (DiametricDatabase)clazz.allocate();
            diametric_database.init(db_asof_t);
            return diametric_database;
        } catch (Throwable t) {
View Full Code Here

    @JRubyMethod
    public IRubyObject since(ThreadContext context, IRubyObject arg) {
        Object t_value = DiametricUtils.convertRubyToJava(context, arg);
        try {
            Database db_since_t = (Database) DiametricService.getFn("datomic.api", "since").invoke(database, t_value);
            RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Database");
            DiametricDatabase diametric_database = (DiametricDatabase)clazz.allocate();
            diametric_database.init(db_since_t);
            return diametric_database;
        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of datomic.Database

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.