Examples of InheritInfo


Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    /**
     * Visit all the other inheritance properties that are not on the root.
     */
    public void visitInheritanceProperties(BeanDescriptor<?> descriptor, PropertyVisitor pv) {

        InheritInfo inheritInfo = descriptor.getInheritInfo();
        if (inheritInfo != null && inheritInfo.isRoot()){
            // add all properties on the children objects
            InheritChildVisitor childVisitor = new InheritChildVisitor(pv);
            inheritInfo.visitChildren(childVisitor);
        }
    }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    ctx.write("create table ");
    writeTableName(descriptor);
    ctx.write(" (").writeNewLine();

    InheritInfo inheritInfo = descriptor.getInheritInfo();
    if (inheritInfo != null && inheritInfo.isRoot()) {
      String discColumn = inheritInfo.getDiscriminatorColumn();
      int discType = inheritInfo.getDiscriminatorType();
      int discLength = inheritInfo.getDiscriminatorLength();
      DbType dbType = ctx.getDbTypeMap().get(discType);
      String discDbType = dbType.renderType(discLength, 0);

      writeColumnName(discColumn, null);
      ctx.write(discDbType);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

  private int[] createIndexPositions(OrmQueryRequest<?> request, SqlTree sqlTree) {

    List<String> chain = sqlTree.buildSelectExpressionChain();
    ColumnMapping columnMapping = request.getQuery().getRawSql().getColumnMapping();

    InheritInfo inheritInfo = request.getBeanDescriptor().getInheritInfo();
    boolean addDiscriminator = inheritInfo != null;
    int offset = addDiscriminator ? 1 : 0;

    int[] indexPositions = new int[chain.size() + offset];
    if (addDiscriminator) {
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    BeanDescriptor<?> localDesc;
    IdBinder localIdBinder;
    EntityBean localBean;

    if (inheritInfo != null) {
      InheritInfo localInfo = inheritInfo.readType(ctx);
      if (localInfo == null) {
        // the bean must be null
        localIdBinder = idBinder;
        localBean = null;
        localType = null;
        localDesc = desc;
      } else {
        localBean = localInfo.createEntityBean();
        localType = localInfo.getType();
        localIdBinder = localInfo.getIdBinder();
        localDesc = localInfo.getBeanDescriptor();
      }

    } else {
      localType = null;
      localDesc = desc;
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

      ctx = t.getPersistenceContext();
      ref = ctx.get(type, id);
    }

    if (ref == null) {
      InheritInfo inheritInfo = desc.getInheritInfo();
      if (inheritInfo != null) {
        // we actually need to do a query because
        // we don't know the type without the
        // discriminator value
        BeanProperty idProp = desc.getIdProperty();
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    EbeanServer server = Ebean.getServer(null);
    Assert.assertNotNull(server);
   
    SpiEbeanServer spiServer = (SpiEbeanServer)server;
    BeanDescriptor<IMRoot> beanDescriptor = spiServer.getBeanDescriptor(IMRoot.class);
    InheritInfo inheritInfo = beanDescriptor.getInheritInfo();
    Assert.assertNotNull(inheritInfo);

   
    IMRootOne one = new IMRootOne();
    one.setName("One Name");
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

      }
    }

    selectProps.setTableJoins(desc.tableJoins());

    InheritInfo inheritInfo = desc.getInheritInfo();
    if (inheritInfo != null) {
      // add sub type properties
      inheritInfo.addChildrenProperties(selectProps);

    }
    return selectProps;
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

      this.selectLastInsertedId = desc.getSelectLastInsertedId();
    }
  }

  private static Bindable getDiscriminator(BeanDescriptor<?> desc){
    InheritInfo inheritInfo = desc.getInheritInfo();
    if (inheritInfo != null){
      return new BindableDiscriminator(inheritInfo);
    } else {
      return null;
    }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    for (BeanProperty prop : propertyMap.values()) {
      prop.setDeployOrder(order++);
      allocateToList(prop);
    }

    InheritInfo inheritInfo = deploy.getInheritInfo();
    if (inheritInfo != null) {
      // Create a BeanProperty for the discriminator column to support
      // using RawSql queries with inheritance
      String discriminatorColumn = inheritInfo.getDiscriminatorColumn();
      DeployBeanProperty discDeployProp = new DeployBeanProperty(deploy, String.class, new ScalarTypeString(), null);
      discDeployProp.setDiscriminator(true);
      discDeployProp.setName(discriminatorColumn);
      discDeployProp.setDbColumn(discriminatorColumn);
     
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.InheritInfo

    this.bootupClasses = bootupClasses;
    initialise();
  }

  public void process(DeployBeanDescriptor<?> desc) {
    InheritInfo inheritInfo = finalMap.get(desc.getBeanType());
    desc.setInheritInfo(inheritInfo);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.