> On June 2, 2014, 12:41 p.m., Nate Cole wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java, > > lines 521-539 > > <https://reviews.apache.org/r/22142/diff/1/?file=601731#file601731line521> > > > > Not sure if I'm misreading current code, but does a ViewInstanceEntity > > already have a handle to the "owned" @ManyToOne ViewEntity? > > > > Can you use that relationship or can you validate a ViewInstanceEntity > > against a non-owned ViewEntity. Ping me if that sounds insane :) > > Tom Beerbower wrote: > No, that makes sense. I pass in the view entity because I want to > validate before the instance is associated with the actual view entity. > Otherwise if the validation fails, I have to disassociate it. > > So, in the view registry it goes something like this ... > > > viewInstance.validate(view); > > ... // if valid ... > > bindViewInstance(view, viewInstance); > > > >
Got it, thanks for clarifying! - Nate ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/22142/#review44504 ----------------------------------------------------------- On June 2, 2014, 12:30 p.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/22142/ > ----------------------------------------------------------- > > (Updated June 2, 2014, 12:30 p.m.) > > > Review request for Ambari, Nate Cole and Sid Wagle. > > > Bugs: AMBARI-5987 > https://issues.apache.org/jira/browse/AMBARI-5987 > > > Repository: ambari > > > Description > ------- > > On view instance create (POST) or any PUT that modifies the view instance > props, the framework should validate that the requirements view properties > have been provided. Otherwise, return error and not allow creation of the > instance. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java > 6456492 > ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java > 2a7f334 > > ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewInstanceEntityTest.java > 7b4fcff > > ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java > fc493ab > > Diff: https://reviews.apache.org/r/22142/diff/ > > > Testing > ------- > > Manual tests. > > New unit tests added. all existing tests pass ... > > Results : > > Tests run: 1644, Failures: 0, Errors: 0, Skipped: 13 > > ... > > > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 22:25.300s > [INFO] Finished at: Mon Jun 02 12:12:02 EDT 2014 > [INFO] Final Memory: 37M/123M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > >
