|
|
|
Re: Annotate Ecore Model with Hibernate-Validator [message #1219487 is a reply to message #1219355] |
Wed, 04 December 2013 08:02 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi David,
To start of:
- clone this repo: http://git.eclipse.org/gitroot/texo/org.eclipse.emf.texo.git/
- then import the projects into a workspace
- for an example of an annotations model see the org.eclipse.emf.texo.orm project
- in this project you can find a model folder with the texo-annotations-orm.ecore
- this shows an annotations model, for all the different model element types (eclass, efeature etc.). You can define a
eclass to annotate each model element type: for example an EPackageValidatorAnnotation which inherits from
EPackageAnnotation, an EClassValidatorAnnotation which inherits from EClassAnnotation, etc.
- To start with your own annotations model, create a new plugin project: org.eclipse.emf.texo.validator with a model
folder and an ecore file. Start of with a simple EClassValidatorAnnotation eclass.
- then within the validator Annotations you can add the eattributes/annotations needed to model the hibernate validators.
- from there you can generate the EMF model code for this model
- the next step is to automatically annotate the model. This is done through annotators. See the
org.eclipse.emf.texo.orm.annotator java package for example of those
- after that a java annotation generator has to be written which translates the validator annotations to java
annotations. Let me give more details when you/we get there.
Check it out and if you are interested (again you are welcome to participate) we can chat (skype: martintaal) about it,
or work together through a shared git project hosted on github.
gr, Martin
On 12/03/2013 03:05 PM, namboka david wrote:
> Fine,
> I'm going to take a look at this. Do you have one or two links towards which I can start my research in order to
> integrate such a model in Texo ?
>
> Regards
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.03696 seconds