private MapSqlParameterSource createQuotaMetaDataParameterMapper(Quota quota) { return createQuotaIdParameterMapper(quota.getId()).addValue("storage_pool_id", quota.getStoragePoolId()) .addValue("quota_name", quota.getQuotaName()) .addValue("description", quota.getDescription()) .addValue("threshold_cluster_percentage", quota.getThresholdClusterPercentage()) .addValue("threshold_storage_percentage", quota.getThresholdStoragePercentage()) .addValue("grace_cluster_percentage", quota.getGraceClusterPercentage()) .addValue("grace_storage_percentage", quota.getGraceStoragePercentage()) .addValue("is_default", quota.isDefault()); }
qModel.getGraceStorage().setEntity(outer_quota.getGraceStoragePercentage()); qModel.getThresholdStorage().setEntity(outer_quota.getThresholdStoragePercentage());
@Mapping(from = org.ovirt.engine.core.common.businessentities.Quota.class, to = Quota.class) public static Quota map(org.ovirt.engine.core.common.businessentities.Quota template, Quota model) { Quota ret = (model==null) ? new Quota() : model; if (template.getId()!=null) { ret.setId(template.getId().toString()); } if (template.getQuotaName()!=null) { ret.setName(template.getQuotaName()); } if (template.getDescription()!=null) { ret.setDescription(template.getDescription()); } if (template.getStoragePoolId()!=null) { if (ret.getDataCenter()==null) { ret.setDataCenter(new DataCenter()); } ret.getDataCenter().setId(template.getStoragePoolId().toString()); } ret.setClusterHardLimitPct(template.getGraceClusterPercentage()); ret.setStorageHardLimitPct(template.getGraceStoragePercentage()); ret.setClusterSoftLimitPct(template.getThresholdClusterPercentage()); ret.setStorageSoftLimitPct(template.getThresholdStoragePercentage()); return ret; }