private AnnotationInstance overrideSchemaCatalogByDefault(
     AnnotationInstance annotationInstance, EntityMappingsMocker.Default defaults) {
   List<AnnotationValue> newAnnotationValueList = new ArrayList<AnnotationValue>();
   newAnnotationValueList.addAll(annotationInstance.values());
   boolean schemaDefined = false;
   boolean catalogDefined = false;
   if (annotationInstance.value("schema") != null) {
     schemaDefined = true;
   }
   if (annotationInstance.value("catalog") != null) {
     catalogDefined = true;
   }
   if (schemaDefined && catalogDefined) {
     return annotationInstance;
   }
   if (!catalogDefined && StringHelper.isNotEmpty(defaults.getCatalog())) {
     newAnnotationValueList.add(
         AnnotationValue.createStringValue("catalog", defaults.getCatalog()));
   }
   if (!schemaDefined && StringHelper.isNotEmpty(defaults.getSchema())) {
     newAnnotationValueList.add(AnnotationValue.createStringValue("schema", defaults.getSchema()));
   }
   return MockHelper.create(
       annotationInstance.name(),
       annotationInstance.target(),
       MockHelper.toArray(newAnnotationValueList));
 }
예제 #2
0
파일: MockHelper.java 프로젝트: enenuki/phd
/*  47:    */   
/*  48:    */   private static AnnotationValue stringValue(String name, String value)
/*  49:    */   {
/*  50: 86 */     if (StringHelper.isNotEmpty(value)) {
/*  51: 87 */       return AnnotationValue.createStringValue(name, value);
/*  52:    */     }
/*  53: 89 */     return null;
/*  54:    */   }
예제 #3
0
 private static AnnotationValue stringValue(String name, String value) {
   if (StringHelper.isNotEmpty(value)) {
     return AnnotationValue.createStringValue(name, value);
   }
   return null;
 }