コード例 #1
0
 @Override
 public boolean delete(Long id) {
   PropertyMeta propertyMeta = propertyMetaRepository.findOne(id);
   jdbcTemplate.execute(this.dropColumn(propertyMeta));
   propertyMetaRepository.delete(propertyMeta);
   try {
     jdbcTemplate.execute(this.dropView(propertyMeta.getTenantId(), propertyMeta.getObjectName()));
   } catch (Exception e) {
   }
   jdbcTemplate.execute(this.createView(propertyMeta.getTenantId(), propertyMeta.getObjectName()));
   return true;
 }
コード例 #2
0
 @Override
 public boolean update(PropertyMeta propertyMeta) {
   propertyMetaRepository.saveAndFlush(propertyMeta);
   try {
     jdbcTemplate.execute(this.dropView(propertyMeta.getTenantId(), propertyMeta.getObjectName()));
   } catch (Exception e) {
   }
   jdbcTemplate.execute(this.createView(propertyMeta.getTenantId(), propertyMeta.getObjectName()));
   return true;
 }
コード例 #3
0
  @Override
  public boolean getByTenantIdAndObjectNameAndDisplayName(
      String tenantId, String objectName, String displayName) {
    List<PropertyMeta> propertiesMeta =
        propertyMetaRepository.findByTenantIdAndObjectNameAndDisplayName(
            tenantId, objectName, displayName);

    if (propertiesMeta != null && propertiesMeta.size() > 0) {
      return true;
    }
    return false;
  }
コード例 #4
0
 // create view T_ORDER_TENANT1005_VIEW as select order_id from T_ORDER
 private String createView(String tenantId, String objectName) {
   List<PropertyMeta> propertiesMeta =
       propertyMetaRepository.findByTenantIdAndObjectName(tenantId, objectName);
   StringBuffer createView = new StringBuffer();
   createView
       .append("create view ")
       .append(objectName)
       .append("_")
       .append(tenantId)
       .append("_")
       .append("VIEW as select ");
   for (PropertyMeta propertyMeta : propertiesMeta) {
     createView
         .append(" ")
         .append(propertyMeta.getInternalName())
         .append(" as ")
         .append(propertyMeta.getDisplayName())
         .append(", ");
   }
   createView.deleteCharAt(createView.lastIndexOf(","));
   createView.append(" from ").append(objectName);
   return createView.toString();
 }
コード例 #5
0
 @Override
 public int getMaxParamIndexByTenantIdAndObjectNameAndType(
     String tenantId, String objectName, UDFTypeEnum type) {
   return propertyMetaRepository.findMaxParamIndexByTenantIdAndObjectNameAndType(
       tenantId, objectName, type);
 }
コード例 #6
0
 @Override
 public PropertyMeta get(Long id) {
   return propertyMetaRepository.findOne(id);
 }
コード例 #7
0
 @Override
 public List<PropertyMeta> getByTenantIdAndObjectName(String tenantId, String objectName) {
   return propertyMetaRepository.findByTenantIdAndObjectName(tenantId, objectName);
 }