Package com.avaje.ebean

Examples of com.avaje.ebean.EbeanServer


        String rawWhere = deriveWhereParentIdSql(true);
        String inClause = targetIdBinder.getIdInValueExpr(parentIdist.size());
       
        String expr = rawWhere+inClause;
        EbeanServer server = getBeanDescriptor().getEbeanServer();
        Query<?> q = (Query<?>)server.find(getPropertyType())
            .where().raw(expr);
      
        for (int i = 0; i < parentIdist.size(); i++) {           
            bindWhereParendId(q, parentIdist.get(i));
        }
       
        return server.findIds(q, t);
    }
View Full Code Here


    @Override
    public void postDelete(BeanPersistRequest<?> request) {
        // deleted resource
        Resource resource = ((ResourceConvertible) request.getBean()).asResource();
        Transaction transaction = request.getTransaction();
        EbeanServer server = request.getEbeanServer();

        // delete related objects
        deleteRelatedWatch(resource, server, transaction);
        deleteRelatedUnwatch(resource, server, transaction);
    }
View Full Code Here

  private static Map<String, EbeanServer> SERVERS = new HashMap<String,EbeanServer>();

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private static EbeanServer createServer(String name, DataSource dataSource)
  {
    EbeanServer result = null;
    ServerConfig cfg = new ServerConfig();
    cfg.loadFromProperties();
    cfg.setName(name);
    cfg.setClasses((List) Play.classloader.getAllClasses());
    cfg.setDataSource(new EbeanDataSourceWrapper(dataSource));
View Full Code Here

    return result;
  }

  protected static EbeanServer checkServer(String name, DataSource ds)
  {
    EbeanServer server = null;
    if (name != null) {
      synchronized (SERVERS) {
        server = SERVERS.get(name);
        if (server == null) {
          server = createServer(name, ds);
View Full Code Here

  @Override
  @SuppressWarnings("unchecked")
  public void beforeInvocation()
  {
    EbeanServer server = defaultServer;

    Request currentRequest = Http.Request.current();
    if (currentRequest != null) {
      // Hook to introduce more data sources
      Map<String, DataSource> ds = (Map<String, DataSource>) currentRequest.args.get("dataSources");
View Full Code Here

  }

  @Override
  public void afterInvocation()
  {
    EbeanServer ebean = EbeanContext.server();
    if (ebean != null && ebean.currentTransaction() != null) ebean.commitTransaction();
  }
View Full Code Here

  }

  @Override
  public void invocationFinally()
  {
    EbeanServer ebean = null;
    try {
      ebean = EbeanContext.server();
    } catch(IllegalStateException e) {
      Logger.error(e, "EbeanPlugin ending transaction in finally");
    }
    if (ebean != null) ebean.endTransaction();
    EbeanContext.set(null);
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebean.EbeanServer

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.