Hi,
In our application we frequently need to read the column width of a string property (typically for validation and for measuring the width of an editable field in a GUI).
I already discovered that this information is available by navigation from the Configuration class, e.g. for a class 'Company' and property 'name'
[quote]
<property
column="COMPANYNAME"
length="64"
name="name"
type="string"
/>
[/quote]
we can find the value "64" using
[code]
Configuration
.getClassMapping("Company")
.getProperty("name")
.getColumnIterator()
.next()
.getLength()
[/code]
For properties of a Component instead of a PersistentClass, things seem
a bit different : if a property is a Component
prop.getType().isComponentType() == true
then I can access Component property names by casting the type
((AbstractComponentType)prop.getType()).getPropertyNames()
But that's as far as I got, from this point on I couldn't find any method
to obtain a Property and its columns.
Could anyone give me a hint here ?
Thanks a lot !
Daan Van Heghe
|