Package org.dmlite.model

Examples of org.dmlite.model.Entity


      final Collection entitiesCollection = new Vector(entities.getCollection());

      for (final Iterator iter = entitiesCollection.iterator(); iter
          .hasNext();)
      {
        final Entity entity = (Entity) iter.next();

        entities.remove(entity);
      }
    }
  }
View Full Code Here


   * @param entity2
   *            entity2
   * @return <code>true</code> if two entities have equal neighbors
   */
  public boolean equalNeighbors(IEntity entity1, IEntity entity2) {
    Entity entityLeft = (Entity) entity1;
    Entity entityRight = (Entity) entity2;
    if (entityLeft == entityRight) {
      return true;
    } else if (entityLeft == null || entityRight == null) {
      return false;
    }
    try {
      NeighborsConfig neighborsConfig = entityLeft.getConceptConfig()
          .getNeighborsConfig();
      for (IEntity config : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) config;
        String neighborCode = neighborConfig.getCode();
        Object entityLeftNeighbor = entityLeft
            .getNeighbor(neighborCode);
        Object entityRightNeighbor = entityRight
            .getNeighbor(neighborCode);
        if (entityLeftNeighbor == null) {
          if (entityRightNeighbor != null) {
            return false;
          }
View Full Code Here

   * @param entity2
   *            entity2
   * @return <code>true</code> if the update is successful
   */
  public boolean updateProperties(IEntity entity1, IEntity entity2) {
    Entity entityLeft = (Entity) entity1;
    Entity entityRight = (Entity) entity2;
    boolean updated = false;
    try {
      // oid cannot be updated
      entityLeft.setCode(entityRight.getCode());
      PropertiesConfig propertiesConfig = entityLeft.getConceptConfig()
          .getPropertiesConfig();
      for (IEntity config : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) config;
        String getMethodName = "get" + propertyConfig.getBigCode();
View Full Code Here

   * @param entity2
   *            entity2
   * @return <code>true</code> if the update is successful
   */
  public boolean updateNeighbors(IEntity entity1, IEntity entity2) {
    Entity entityLeft = (Entity) entity1;
    Entity entityRight = (Entity) entity2;
    boolean updated = false;
    try {
      NeighborsConfig neighborsConfig = entityLeft.getConceptConfig()
          .getNeighborsConfig();
      for (IEntity config : neighborsConfig) {
View Full Code Here

   */
  public void output(IEntities entities, String title) {
    Collection<IEntity> c = entities.getCollection();
    log.info("*** " + title + " ***");
    for (IEntity e : c) {
      Entity entity = (Entity) e;
      entity.output(entity.getClass().getSimpleName());
    }
  }
View Full Code Here

TOP

Related Classes of org.dmlite.model.Entity

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.