Examples of BaseEntity


Examples of org.apache.cayenne.testdo.inherit.BaseEntity

     * used.
     */
    public void testCAY1008() {
        RelatedEntity related = context.newObject(RelatedEntity.class);

        BaseEntity base = context.newObject(BaseEntity.class);
        base.setToRelatedEntity(related);

        assertEquals(1, related.getBaseEntities().size());
        assertEquals(0, related.getSubEntities().size());

        SubEntity sub = context.newObject(SubEntity.class);
View Full Code Here

Examples of org.apache.cayenne.testdo.inherit.BaseEntity

     * used.
     */
    public void testCAY1008() {
        RelatedEntity related = context.newObject(RelatedEntity.class);

        BaseEntity base = context.newObject(BaseEntity.class);
        base.setToRelatedEntity(related);

        assertEquals(1, related.getBaseEntities().size());
        assertEquals(0, related.getSubEntities().size());

        SubEntity sub = context.newObject(SubEntity.class);
View Full Code Here

Examples of org.apache.openjpa.persistence.enhance.common.apps.BaseEntity

        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(pm);

        BaseEntity be = (BaseEntity) newInstance(pm, BaseEntity.class);
        be.setShortField((short) 0);
        pm.persist(be);

        be = (BaseEntity) newInstance(pm, BaseEntity.class);
        be.setShortField((short) 1);
        pm.persist(be);

        DerivedEntity de = (DerivedEntity) newInstance(pm, DerivedEntity.class);
        de.setShortField((short) 2);
        de.setOneToOne((BasicSubclassInstance) newInstance(pm,
View Full Code Here

Examples of org.apache.openjpa.persistence.enhance.common.apps.BaseEntity

        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(pm);

        BaseEntity be = (BaseEntity) newInstance(pm, BaseEntity.class);
        be.setShortField((short) 0);
        pm.persist(be);

        be = (BaseEntity) newInstance(pm, BaseEntity.class);
        be.setShortField((short) 1);
        pm.persist(be);

        DerivedEntity de = (DerivedEntity) newInstance(pm, DerivedEntity.class);
        de.setShortField((short) 2);
        de.setOneToOne((BasicSubclassInstance) newInstance(pm,
View Full Code Here

Examples of org.apache.uima.alchemy.ts.entity.BaseEntity

  public void process(JCas cas, Results results) throws Exception {
    for (Entity entity : ((EntitiesResults) results).getEntities().getEntities()) {

      // get feature structure for the entity
      BaseEntity fs = getFeatureStructure(entity.getType(), cas);

      if (fs != null) {

        Type type = fs.getType();

        /* set each FS feature value */
        fs.setFeatureValueFromString(type.getFeatureByBaseName("count"), entity.getCount()); // count
        fs.setFeatureValueFromString(type.getFeatureByBaseName("text"), entity.getText()); // text
        fs.setFeatureValueFromString(type.getFeatureByBaseName("relevance"), entity.getRelevance()); // relevance
        if (entity.getDisambiguated() != null) {
          fs.setFeatureValueFromString(type.getFeatureByBaseName("disambiguation"), entity
                  .getDisambiguated().getName()); // disambiguation name
          fs.setFeatureValueFromString(type.getFeatureByBaseName("dbpedia"), entity
                  .getDisambiguated().getDbpedia()); // dbpedia
          fs.setFeatureValueFromString(type.getFeatureByBaseName("website"), entity
                  .getDisambiguated().getWebsite()); // website
          fs.setFeatureValueFromString(type.getFeatureByBaseName("subType"), entity
                  .getDisambiguated().getSubType()); // subtype
          fs.setFeatureValueFromString(type.getFeatureByBaseName("geo"), entity.getDisambiguated()
                  .getGeo()); // geo
          fs.setFeatureValueFromString(type.getFeatureByBaseName("opencyc"), entity
                  .getDisambiguated().getOpencyc()); // opencyc
          fs.setFeatureValueFromString(type.getFeatureByBaseName("yago"), entity.getDisambiguated()
                  .getYago()); // yago
          fs.setFeatureValueFromString(type.getFeatureByBaseName("umbel"), entity
                  .getDisambiguated().getUmbel()); // umbel
          fs.setFeatureValueFromString(type.getFeatureByBaseName("freebase"), entity
                  .getDisambiguated().getFreebase()); // freebase
          fs.setFeatureValueFromString(type.getFeatureByBaseName("ciaFactbook"), entity
                  .getDisambiguated().getCiaFactbook()); // ciaFactbook
          fs.setFeatureValueFromString(type.getFeatureByBaseName("census"), entity
                  .getDisambiguated().getCensus()); // census
          fs.setFeatureValueFromString(type.getFeatureByBaseName("geonames"), entity
                  .getDisambiguated().getGeonames()); // geonames
          fs.setFeatureValueFromString(type.getFeatureByBaseName("musicBrainz"), entity
                  .getDisambiguated().getMusicBrainz()); // musicBrainz
        }
        if (entity.getQuotations() != null && entity.getQuotations().getQuotations() != null
                && entity.getQuotations().getQuotations().size() > 0) {
          StringArray quotationsFeatureStructure = new StringArray(cas, entity.getQuotations()
                  .getQuotations().size());
          int i = 0;
          for (String quotation : entity.getQuotations().getQuotations()) {
            quotationsFeatureStructure.set(i, quotation);
            i++;
          }
          fs.setFeatureValue(type.getFeatureByBaseName("quotations"), quotationsFeatureStructure);
        }
        if (entity.getSentiment() != null) {
          SentimentFS sentimentFS = new SentimentFS(cas);
          sentimentFS.setScore(entity.getSentiment().getScore());
          sentimentFS.setSentimentType(entity.getSentiment().getType());
          sentimentFS.addToIndexes();
          fs.setFeatureValue(type.getFeatureByBaseName("sentiment"), sentimentFS);
        }
        cas.addFsToIndexes(fs);
        /* build annotations on this fs */
        buildAnnotations(cas, fs);
      }
View Full Code Here

Examples of org.apache.uima.alchemy.ts.entity.BaseEntity

    }

  }

  private BaseEntity getFeatureStructure(String type, JCas aJCas) {
    BaseEntity fsObject = null;
    String typeName = new StringBuilder(ENTITY_PACKAGE_NAME).append(type).toString();
    Class<?> typeClass = getClassFromName(typeName);
    if (typeClass != null) {
      try {
        /* use reflection to build a BaseEntity object */
 
View Full Code Here

Examples of org.happyfaces.domain.base.BaseEntity

     * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent, java.lang.String)
     */
    @SuppressWarnings("unchecked")
    public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
        BaseEntity entity;
        if (value == null || "".equals(value)) {
            entity = null;
        } else {
            String[] idAndClass = value.split("_");

View Full Code Here

Examples of org.happyfaces.domain.base.BaseEntity

            return "";
        }
        if (!(value instanceof BaseEntity)) {
            throw new IllegalArgumentException("This converter only handles instances of BaseEntity");
        }
        BaseEntity entity = (BaseEntity) value;
        return entity.getId() == null ? "" : entity.getId().toString() + "_" + entity.getClass().getCanonicalName();
    }
View Full Code Here

Examples of org.libreplan.business.common.BaseEntity

    }

    protected abstract void detachFromAllocation();

    public final boolean belongsToSomeOf(Map<Long, Set<BaseEntity>> allocations) {
        BaseEntity parent = getParent();
        if (parent.getId() == null) {
            Set<BaseEntity> entitiesWithNullId = allocations.get(null);
            return entitiesWithNullId != null
                    && entitiesWithNullId.contains(parent);
        }
        Set<BaseEntity> set = allocations.get(parent.getId());
        return set != null;
    }
View Full Code Here

Examples of org.libreplan.business.common.BaseEntity

            }
            if (a.size() != b.size()) {
                return false;
            }
            for (int i = 0; i < a.size(); i++) {
                BaseEntity aElement = a.get(i);
                BaseEntity bElement = b.get(i);
                if (!ObjectUtils.equals(aElement.getId(), bElement.getId())) {
                    return false;
                }
            }
            return true;
        }
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.