I guess that the reason is that hibernate validation is triggered when objects are persisted. I think it is possible to activate it in other ways also, but we haven't done that in sculptor. In trunk javax.validation api is used instead of hibernate validation. You can investigate how to use that and if it is possible to activate it for DTOs also./PatrikOn Tue, Aug 16, 2011 at 6:50 PM, Torsten Juergeleit <torsten.j...@gmail.com> wrote:Sculptors declarative validation support for persistable domain objects is nice.
Unluckily this feature is not supported for data transfer objects. Btw. what's the reason for this?
Now I'm wondering how to add a similar kind of declarative validation to data transfer objects by leveraging Sculptor.
What approaches for client-side validation of sculptor-generated DTOs are you using?
/Torsten
/Patrik
I don't understand how that could be wrong? Are you running from maven, i.e. have you the latest snapshot of everything in classpath? I have deployed a new snapshot now. In case something was wrong with previous, due to the full disk.
/Patrik
On Fri, Sep 30, 2011 at 6:29 PM, Torsten Juergeleit <torsten.j...@gmail.com> wrote:
I tried this feature with the latest snapshot release (2.1.0-20110926.184716-5) and got the following exception:
[INFO] 3390 ERROR org.eclipse.xtend.XtendComponent - Error in Component of type org.eclipse.xtend.XtendComponent:
[INFO] EvaluationException : Couldn't find property 'assertTrue' for type sculptordsl::DslDtoAttribute
[INFO] transformation::DslTransformation.ext[33742,20] on line 689 'attribute.assertTrue'
[INFO] transformation::DslTransformation.ext[24030,28] on line 514 'attribute.handleValidation()'
[INFO] transformation::DslTransformation.ext[15968,29] on line 337 'dslDto.attributes.transform()'
[INFO] transformation::DslTransformation.ext[2015,32] on line 50 'module.domainObjects.transform()'
[INFO] transformation::DslTransformation.ext[1227,25] on line 34 'allDslModules.transform()'
[INFO] nofile[0,47] on line 1 'transform((DslModel)model.first().eContainer)'
Are there any problems with the modifications for "Sculptordsl.xtext"?
/Torsten
On Sunday, 21 August 2011 09:32:33 UTC+2, Patrik Nordwall wrote:
Thanks for the contribution. I have applied the patch and committed to trunk.It's not much to do about the duplication you mention. In the DSL the inheritance hierarchies are different for DTO and other DO. The duplication is a drawback of that. I don't wan't to manually adjust the dsl model, easier if it is completely generated by the xtext grammar.