The SDO spec will be addressing standard instance properties that allow
values of facets to be retrieved from types and properties. Until that time
it allows implementations to define their own, adn we do that in Tuscany.
See
http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MetadataInstancePropertiesTestCase.java
You can uncomment the lines of code that print out the values of instance
properties. My initioal digging around suggests that this is the set of
Properties we support.
"minExclusive"
"minInclusive"
"maxExclusive"
"maxInclusive"
"totalDigits"
"fractionDigits"
"length"
"minLength"
"maxLength"
"enumeration"
"whiteSpace"
Kelvin.
On 20/12/2007, Joerg Selig <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> is it possible to restrict a SDO DataType via the SDO API? For instance,
> i should like to restrict a 'commonj.sdo.String' to a maximal length of
> 2 characters or a 'commonj.sdo.Integer' to a maximal value of 999.
>
> I create the SDOs dynamically.
>
> Example:
> 8< --------------------------------------------------------
>
> Type stringType =
> TypeHelper.INSTANCE.getType("commonj.sdo", "String");
>
> DataObject fooType =
> DataFactory.INSTANCE.create("commonj.sdo", "Type");
> fooType.set("uri", "http://example.com/foo");
> fooType.set("name", "Foo");
>
> DataObject fooProperty =
> fooType.createDataObject("property");
> fooProperty.set("name", "fooProperty");
> fooProperty.set("type", stringType);
>
> -------------------------------------------------------- >8
>
> I should like to replace the 'stringType' with a restricted string type.
> I don't need a validation, it's enough to have the information about the
> restriction inside of annotations or the like.
>
>
> Thanks in advance
>
> Regards,
> Joerg Selig
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>