Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] [OT]-ish Reading Annotation Data

I'm not an expert in this area, but here's some pseudo code that should work

Class entityClass = entity.getClass();
Method m = c.getMethod("getter", typeOfVal.class);
Column annotation = m.getAnnotation(Column .class);
int len = annotation.intValue();

Give it a go and lemme know if it works.

Thanks,
Vackar

>>> RogerV <roger.varley@xxxxxxxxxxxxxx> 28/09/2009 14:16 >>>

Is there a way of retrieving annotation data from an entity? Specifically I'm
using the @Column(length=) annotation in a Struts 2 web app. It would be
useful if I could read this data and use it to validate the incoming field
length and to use it on the result to set the width of the input field.

Regards
-- 
View this message in context: http://www.nabble.com/-OT--ish-Reading-Annotation-Data-tp25645176p25645176.html 
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx 
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

The University of Dundee is a registered Scottish charity, No: SC015096


Back to the top