> On Aug. 26, 2014, 3:15 p.m., Abraham Elmahrek wrote: > > common/src/main/java/org/apache/sqoop/model/FormUtils.java, lines 546-551 > > <https://reviews.apache.org/r/25074/diff/1/?file=669585#file669585line546> > > > > I think this could be made public and be a little bit more robust. > > Some of the logic could be encapsulated in this method. For instance, you > > could pass a Field object and the associated annotation. Then choose which > > name to use. IE: > > > > public static String getFormName(Field member, Form annotation) { > > if (StringUtils.empty(annotation.getName())) { > > return member.getName(); > > } else { > > checkForValidFormName(...); > > return annotation.getName(); > > } > > } > > > > We might be able to use this code in the future for Input's if we want > > to!
still needs to pass arnd the known form names for uniqueness check. other than that incorporated this. Not sure how much reusable it is. I usually tend to refactor when both need to be supported. The Form and Input annotation may not even have the name field, just tol! - Veena ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25074/#review51592 ----------------------------------------------------------- On Aug. 26, 2014, 6:14 p.m., Veena Basavaraj wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25074/ > ----------------------------------------------------------- > > (Updated Aug. 26, 2014, 6:14 p.m.) > > > Review request for Sqoop, Abraham Elmahrek, Gwen Shapira, and Jarek Cecho. > > > Bugs: SQOOP-1436 > https://issues.apache.org/jira/browse/SQOOP-1436 > > > Repository: sqoop-sqoop2 > > > Description > ------- > > https://issues.apache.org/jira/browse/SQOOP-1436 > As discussed in the SQOOP-1436, this feature gives the ability to specifiy a > custom form name. It is optional, if given it is persisted in the metadata > repo. Methods that convert the form fields to JSON have also been modified to > read the custom form name attribute. basic validation for uniqueness, length > and pattern have been added > > Existing unit tests modified to support the custom form name attribute > unit tests added for validation cases > > Note: there are formatting changes since I used the mandated eclipse > formatter.xml in the IDE > > > Diffs > ----- > > common/src/main/java/org/apache/sqoop/model/Form.java 4321582 > common/src/main/java/org/apache/sqoop/model/FormUtils.java 27db8af > common/src/main/java/org/apache/sqoop/model/ModelError.java 1f466fe > common/src/test/java/org/apache/sqoop/model/TestFormUtils.java 08dfa7b > > Diff: https://reviews.apache.org/r/25074/diff/ > > > Testing > ------- > > mvn test and integration tests pass. > > > Thanks, > > Veena Basavaraj > >
