Examples of BaseEntity


Examples of br.com.kuntzer.rodrigo.cursoviasoft.entity.BaseEntity

    public String getAsString(FacesContext ctx, UIComponent component, Object value) { 
 
        if (value != null 
                && !"".equals(value)) { 
 
            BaseEntity entity = (BaseEntity) value; 
 
            this.addAttribute(component, entity)
 
            Serializable codigo = entity.getId()
            if (codigo != null) { 
                return String.valueOf(codigo)
           
        } 
 
View Full Code Here

Examples of com.architecture.core.dao.entity.BaseEntity

    protected final Logger logger = Logger.getLogger(this.getClass());

    @Override
    public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
        if (entity instanceof BaseEntity) {
            BaseEntity baseEntity = (BaseEntity) entity;
            Timestamp currentTime = new Timestamp(new Date().getTime());
            baseEntity.setCreateTime(currentTime);
            baseEntity.setUpdateTime(currentTime);
        }
        return true;
    }
View Full Code Here

Examples of com.architecture.core.dao.entity.BaseEntity

    public void onCollectionUpdate(Object obj, Serializable key) throws CallbackException {

        Timestamp currentTime = new Timestamp(new Date().getTime());

        if (obj instanceof BaseEntity) {
            BaseEntity baseEntity = (BaseEntity) obj;

            //当做逻辑删除操作时,则只更新删除时间,其它情况则只是普通更新,只需修改更新时间
            if (true == baseEntity.isDeleted()) {
                baseEntity.setDeleteTime(currentTime);
            }else {
                baseEntity.setUpdateTime(currentTime);
            }
        } else if (obj instanceof Collection) {          //如果为批量更新,则批量修改更新时间
            Collection collection = (Collection) obj;
            for (Object cell : collection) {
                if (cell instanceof BaseEntity) {
                    BaseEntity baseEntity = (BaseEntity) cell;

                    //当做逻辑删除操作时,则只更新删除时间,其它情况则只是普通更新,只需修改更新时间
                    if (true == baseEntity.isDeleted()) {
                        baseEntity.setDeleteTime(currentTime);
                    }else {
                        baseEntity.setUpdateTime(currentTime);
                    }
                }
            }
        }
View Full Code Here

Examples of com.dodo.blog.model.BaseEntity

        if ( id == null )
        {
            return;
        }

        BaseEntity entity = datastore.find( entityClass, id );

        if ( entity != null )
        {
            datastore.delete( entity );
        }
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

        }

        @Override
        public boolean remove() {
            Location location = entity.getLocation();
            BaseEntity state = entity.getState();
            boolean success = entity.remove();
            if (state != null && success) {
                changeSet.add(new EntityRemove(location, state));
            }
            return success;
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

        if (entity != null) {
            String id = EntityList.getEntityString(entity);
            if (id != null) {
                NBTTagCompound tag = new NBTTagCompound();
                entity.writeToNBT(tag);
                return new BaseEntity(id, NBTConverter.fromNative(tag));
            } else {
                return null;
            }
        } else {
            return null;
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

     */
    StoredEntity(Location location, BaseEntity entity) {
        checkNotNull(location);
        checkNotNull(entity);
        this.location = location;
        this.entity = new BaseEntity(entity);
    }
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

        return entity;
    }

    @Override
    public BaseEntity getState() {
        return new BaseEntity(entity);
    }
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

                    CompoundTag compound = (CompoundTag) tag;
                    String id = compound.getString("id");
                    Location location = NBTConversions.toLocation(clipboard, compound.getListTag("Pos"), compound.getListTag("Rotation"));

                    if (!id.isEmpty()) {
                        BaseEntity state = new BaseEntity(id, compound);
                        clipboard.createEntity(location, state);
                    }
                }
            }
        } catch (IOException ignored) { // No entities? No problem
View Full Code Here

Examples of com.sk89q.worldedit.entity.BaseEntity

        // Entities
        // ====================================================================

        List<Tag> entities = new ArrayList<Tag>();
        for (Entity entity : clipboard.getEntities()) {
            BaseEntity state = entity.getState();

            if (state != null) {
                Map<String, Tag> values = new HashMap<String, Tag>();

                // Put NBT provided data
                CompoundTag rawTag = state.getNbtData();
                if (rawTag != null) {
                    values.putAll(rawTag.getValue());
                }

                // Store our location data, overwriting any
                values.put("id", new StringTag(state.getTypeId()));
                values.put("Pos", writeVector(entity.getLocation().toVector(), "Pos"));
                values.put("Rotation", writeRotation(entity.getLocation(), "Rotation"));

                CompoundTag entityTag = new CompoundTag(values);
                entities.add(entityTag);
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.