Package org.xorm

Examples of org.xorm.RelationshipMapping$Endpoint


        this.destination = destination;
    }

    @Override
    public IoFuture<Connection> connect() throws IOException {
        final Endpoint endpoint = this.endpointInjectedValue.getValue();
        return endpoint.connect(this.destination, this.connectionCreationOptions, getCallbackHandler());
    }
View Full Code Here


        safeClose(endpoint);
    }

    /** {@inheritDoc} */
    public synchronized Endpoint getValue() throws IllegalStateException {
        final Endpoint endpoint = this.endpoint;
        if (endpoint == null) throw new IllegalStateException();
        return endpoint;
    }
View Full Code Here

   {
      URL wsdlURL = new URL(endpointURL + "?wsdl");
      QName serviceName = new QName(targetNS, "EndpointService");

      Service service = Service.create(wsdlURL, serviceName);
      Endpoint port = (Endpoint)service.getPort(Endpoint.class);

      Object retObj = port.echo("Hello");
      assertEquals("Hello", retObj);
   }
View Full Code Here

   {
      URL wsdlURL = new URL(endpointURL + "?wsdl");
      QName serviceName = new QName(targetNS, "EndpointService");

      Service service = Service.create(wsdlURL, serviceName);
      Endpoint port = (Endpoint)service.getPort(Endpoint.class);

      Object retObj = port.echo("Hello");
      assertEquals("Hello", retObj);
   }
View Full Code Here

         (lastColumn, Operator.IN, collectionToIDs((Collection) owner.evaluate(this))));
    return true;
      }

      String field = ((Expression.Member) owner).getName();
      RelationshipMapping rm = mapping.getRelationship(field);
      ClassMapping targetMapping = modelMapping.getClassMapping
    (rm.getSource().getElementClass());
      Selector s = null;
      Selector old = selector;
      if (operand instanceof Expression.Variable) {
    // This field is really the variable, using targetMapping
    selector = new Selector(targetMapping.getTable(),
          null);
      } else if (operand instanceof Expression.Parameter) {
    if (param != null) {
        param = XORM.extractPrimaryKey(JDOHelper.getObjectId(param));
    }
    selector = new Selector
        (rm.getTarget().getColumn().getTable(),
         new SimpleCondition
       (rm.getTarget().getColumn(),
        Operator.EQUAL, param));
    selector.setJoinColumn(rm.getTarget().getColumn());

    // If we have a parameter on a MToN mapping,
    // we can skip the target table
    selector.setJoinColumn(rm.getSource().getColumn());
    old.setCondition
        (new SimpleCondition(mapping.getTable().getPrimaryKey(),
           Operator.CONTAINS, selector));
    return true;
      }
      if (rm.isMToN()) {
    s = new Selector
        (rm.getTarget().getColumn().getTable(),
         new SimpleCondition
       (rm.getTarget().getColumn(),
        Operator.EQUAL,
        selector));
      } else {
    s = selector;
      }
      s.setJoinColumn(rm.getSource().getColumn());
      old.setCondition
    (new SimpleCondition(mapping.getTable().getPrimaryKey(),
             Operator.CONTAINS, s));
      if (operand instanceof Expression.Variable) {
    varToSelector.put(((Expression.Variable) operand).getName(),
          top);
    top = null;
      }
  } else if ("startsWith".equals(name)) {
      selector.setCondition
    (new SimpleCondition(column, Operator.STARTS_WITH,
             param));
  } else if ("endsWith".equals(name)) {
      selector.setCondition
    (new SimpleCondition(column, Operator.ENDS_WITH,
             param));
  } else if ("strstr".equals(name)) {
      selector.setCondition
    (new SimpleCondition(column, Operator.STR_CONTAINS,
             param));
  } else if ("isEmpty".equals(name)) {
      // model.model_id where model_id = model_platform
      //  .model_id where model_id is null
      String field = ((Expression.Member) exp.getOwner()).getName();
      RelationshipMapping rm = mapping.getRelationship(field);
      Selector s = new Selector
    (rm.getSource().getColumn().getTable(),
     new SimpleCondition(rm.getSource().getColumn(),
             Operator.EQUAL, null));
      s.setJoinColumn(rm.getSource().getColumn());
      s.setOuterJoin(true);
      selector.setCondition(new SimpleCondition
          (selector.getTable().getPrimaryKey(),
           Operator.CONTAINS, s));
  }
View Full Code Here

TOP

Related Classes of org.xorm.RelationshipMapping$Endpoint

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.