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));
 }
Ejemplo n.º 2
0
/*  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:    */   }
Ejemplo n.º 3
0
 private static AnnotationValue stringValue(String name, String value) {
   if (StringHelper.isNotEmpty(value)) {
     return AnnotationValue.createStringValue(name, value);
   }
   return null;
 }