Examples of EntityState


Examples of com.breezejs.save.EntityState

        if (id != null)
        {
            EntityInfo relatedEntityInfo = findInSaveMap(propType.getReturnedClass(), id);

            if (relatedEntityInfo == null) {
              EntityState state = entityInfo.entityState;
//              if (state == EntityState.Added || state == EntityState.Modified || (state == EntityState.Deleted
//                  && propType.getForeignKeyDirection() != ForeignKeyDirection.FOREIGN_KEY_TO_PARENT)) {
              if (state != EntityState.Deleted || propType.getForeignKeyDirection() != ForeignKeyDirection.FOREIGN_KEY_TO_PARENT) {
                  String relatedEntityName = propType.getName();
                    relatedEntity = session.load(relatedEntityName, (Serializable) id, LockOptions.NONE);
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

      if (log.isLoggable(Level.FINER))
        log.log(Level.FINER, L.l("removing entity class " + instance.getClass().getName() +
                                 " PK: " + instance.__caucho_getPrimaryKey() +
                                 " state: " + instance.__caucho_getEntityState()));

      EntityState state = instance.__caucho_getEntityState();

      if (EntityState.P_DELETING.ordinal() <= state.ordinal()) {
        if (log.isLoggable(Level.FINER))
          log.log(Level.FINER, L.l("remove is ignoring entity in state " + state));

        return;
      }
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

      Object pk = instance.__caucho_getPrimaryKey();

      Entity oldEntity = getEntity(instance.getClass(), pk);

      if (oldEntity != null) {
        EntityState state = instance.__caucho_getEntityState();

        if (state.ordinal() <= EntityState.TRANSIENT.ordinal()
            || EntityState.P_DELETING.ordinal() <= state.ordinal()) {
          throw new IllegalArgumentException(L.l("refresh() operation can only be applied to a managed entity instance. The entity state is '{0}' for object of class '{0}' with PK '{1}'", className, pk, state == EntityState.TRANSIENT ? "TRANSIENT" : "DELETING or DELETED"));
        }
      }
      else
        throw new IllegalArgumentException(L.l("refresh() operation can only be applied to a managed entity instance. There was no managed instance of class '{0}' with PK '{1}'", className, pk));
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

    // jpa/11a8
    if (entity.__caucho_getConnection() != this) {
      return false;
    }

    EntityState state = entity.__caucho_getEntityState();
    if (isInTransaction() && ! state.isTransactional()) {
      // jpa/11a6, jpa/1800
      return false;
    }

    // jpa/0j5f
    if (EntityState.P_DELETING.ordinal() <= state.ordinal()) {
      return false;
    }

    return true;
  }
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

    if (isActiveTransaction()) {
      // jpa/0ga8
      entity.__caucho_setConnection(this);

      // jpa/0j5f
      EntityState state = entity.__caucho_getEntityState();

      //if (state.ordinal() < EntityState.P_DELETING.ordinal())
      if (state == EntityState.P_NON_TRANSACTIONAL)
        entity.__caucho_setEntityState(EntityState.P_TRANSACTIONAL);
    }
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

   * Persists the entity.
   */
  private Entity persistInternal(Entity entity)
    throws Exception
  {
    EntityState state = entity.__caucho_getEntityState();

    if (state == null)
      state = EntityState.TRANSIENT;

    switch (state) {
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

      Entity entity = checkEntityType(entityT, "merge");

      if (log.isLoggable(Level.FINER)) {
        String className = entity.getClass().getName();
        Object pk = entity.__caucho_getPrimaryKey();
        EntityState state = entity.__caucho_getEntityState();

        log.finer(L.l("recursiveMerge({0}[{1}] state: '{2}'",
                      className, pk, state));
      }
View Full Code Here

Examples of com.caucho.amber.entity.EntityState

      if (newEntity == null)
        return newEntity;

      Class entityClass = newEntity.getClass();
      String className = newEntity.getClass().getName();
      EntityState state = newEntity.__caucho_getEntityState();

      Object pk = newEntity.__caucho_getPrimaryKey();

      if (log.isLoggable(Level.FINER))
        log.finer(L.l("{0}[{1}] amber merge state='{2}'",
                      entityClass.getSimpleName(), pk, state));

      if (state.isDeleting()) {
        // removed entity instance
        throw new IllegalArgumentException(L.l("{0}: merge operation cannot be applied to a removed entity instance",
                                               entityClass));
      }
View Full Code Here

Examples of org.apache.james.mime4j.stream.EntityState

            handler.endHeader();
        } else {
            mimeTokenStream.parse(instream);
        }
        OUTER: for (;;) {
            EntityState state = mimeTokenStream.getState();
            switch (state) {
                case T_BODY:
                    BodyDescriptor desc = mimeTokenStream.getBodyDescriptor();
                    InputStream bodyContent;
                    if (contentDecoding) {
View Full Code Here

Examples of org.apache.james.mime4j.stream.EntityState

    }

    private MaximalBodyDescriptor describe(byte[] mail, int zeroBasedPart) throws Exception {
        ByteArrayInputStream bias = new ByteArrayInputStream(mail);
        parser.parse(bias);
        EntityState state = parser.next();
        while (state != EntityState.T_END_OF_STREAM && zeroBasedPart>=0) {
            state = parser.next();
            if (state == EntityState.T_BODY) {
                --zeroBasedPart;
            }
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.