diff --git a/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/ui/NewFieldWizard.java b/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/ui/NewFieldWizard.java index ea829248a6..e5b06314ce 100644 --- a/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/ui/NewFieldWizard.java +++ b/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/ui/NewFieldWizard.java @@ -57,7 +57,7 @@ public class NewFieldWizard extends AbstractJavaEECommand implements UIWizard @Inject @WithAttributes(label = "Field Name", description = "The field name to be created in the target entity", required = true) - private UIInput fieldName; + private UIInput named; @Inject @WithAttributes(label = "Type", description = "The type intended to be used for this field", type = InputType.JAVA_CLASS_PICKER, required = true) @@ -140,7 +140,7 @@ public Boolean call() throws Exception return Date.class.getName().equals(typeValue) || Calendar.class.getName().equals(typeValue); } }); - builder.add(entity).add(fieldName).add(typeName).add(temporalType).add(length).add(relationshipType).add(lob) + builder.add(entity).add(named).add(typeName).add(temporalType).add(length).add(relationshipType).add(lob) .add(primitive); } @@ -204,7 +204,7 @@ public String convert(RelationshipType source) public Result execute(UIExecutionContext context) throws Exception { JavaResource javaResource = entity.getValue(); - String fieldNameStr = fieldName.getValue(); + String fieldNameStr = named.getValue(); Field field; JavaClass targetEntity = (JavaClass) javaResource.getJavaSource(); RelationshipType value = relationshipType.getValue(); @@ -243,7 +243,7 @@ else if (lob.getValue()) facet.saveJavaSource(field.getOrigin()); } context.getUIContext().setSelection(javaResource); - return Results.success("Field " + fieldName.getValue() + " created"); + return Results.success("Field " + named.getValue() + " created"); } else { @@ -262,9 +262,9 @@ public void validate(UIValidationContext validator) if (javaResource != null) { JavaClass javaClass = (JavaClass) javaResource.getJavaSource(); - if (javaClass.hasField(fieldName.getValue())) + if (javaClass.hasField(named.getValue())) { - validator.addValidationError(entity, "Field '" + fieldName.getValue() + "' already exists"); + validator.addValidationError(entity, "Field '" + named.getValue() + "' already exists"); } } } @@ -310,7 +310,7 @@ else if (val.equals("character")) public NavigationResult next(UIContext context) throws Exception { context.setAttribute(JavaResource.class, entity.getValue()); - context.setAttribute("fieldName", fieldName.getValue()); + context.setAttribute("fieldName", named.getValue()); context.setAttribute("fieldType", typeName.getValue()); context.setAttribute(RelationshipType.class, relationshipType.getValue()); context.getAttribute(RelationshipType.class);