You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ron Gavlin <rg...@yahoo.com> on 2007/02/09 20:16:51 UTC

public static boolean SDOUtil.isNillable(Property property) implementation?

Greetings,

I need a way to determine if an SDO property is nillable. I suspect EMF APIs are required to implement such a method but it isn't obvious to me how to use EMF to do it? Would a static method SDOUtil.isNillable(Property property) be an appropriate place to implement such a method? Any suggestions for an implementation?

Regards,

- Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: public static boolean SDOUtil.isNillable(Property property) implementation?

Posted by Yang ZHONG <le...@gmail.com>.
Just FYI, there're many other cases EMF sets unsettable true regardless of
nillable or not. (XML Schema to Ecore Mapping)

On 2/9/07, Yang ZHONG <le...@gmail.com> wrote:
>
> Normally, EMF maps common simple type to Java primitive class, e.g.
> xsd:int to Java int.
> However, if nillable element, EMF maps the element type to Java wrapper
> class, e.g. java.lang.Integer, which can be Java null.
>
> By design, EMF sets unsettable true if nillable. (XML Schema to Ecore
> Mapping p18 5.4 Nillable element)
>
> Hope those 2 info can help you with the isNillable impl.
>
> On 2/9/07, Ron Gavlin <rg...@yahoo.com> wrote:
> >
> > Greetings,
> >
> > I need a way to determine if an SDO property is nillable. I suspect EMF
> > APIs are required to implement such a method but it isn't obvious to me how
> > to use EMF to do it? Would a static method SDOUtil.isNillable(Property
> > property) be an appropriate place to implement such a method? Any
> > suggestions for an implementation?
> >
> > Regards,
> >
> > - Ron
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
>
>
> --
>
> Yang ZHONG




-- 

Yang ZHONG

Re: public static boolean SDOUtil.isNillable(Property property) implementation?

Posted by Yang ZHONG <le...@gmail.com>.
Normally, EMF maps common simple type to Java primitive class, e.g. xsd:int
to Java int.
However, if nillable element, EMF maps the element type to Java wrapper
class, e.g. java.lang.Integer, which can be Java null.

By design, EMF sets unsettable true if nillable. (XML Schema to Ecore
Mapping p18 5.4 Nillable element)

Hope those 2 info can help you with the isNillable impl.

On 2/9/07, Ron Gavlin <rg...@yahoo.com> wrote:
>
> Greetings,
>
> I need a way to determine if an SDO property is nillable. I suspect EMF
> APIs are required to implement such a method but it isn't obvious to me how
> to use EMF to do it? Would a static method SDOUtil.isNillable(Property
> property) be an appropriate place to implement such a method? Any
> suggestions for an implementation?
>
> Regards,
>
> - Ron
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>


-- 

Yang ZHONG

Re: public static boolean SDOUtil.isNillable(Property property) implementation?

Posted by Frank Budinsky <fr...@ca.ibm.com>.
SDO 2.1 has added a new method for this, Property.isNullable(). 
Unfortunately we haven't implemented in yet in Tuscany (it currently 
throws UnsupportedOperationException if you call it).

The implementation plan is to add an EAnnotation on EStructuralFeatures 
created in SDOXSDEcoreBuilder, to store the nillable value, and then use 
that EAnnotation to implement the new isNullable() method.

It's not on our high priority list but If you'd like to do it and provide 
a patch, that would be most welcome.

Thanks,
Frank.




Ron Gavlin <rg...@yahoo.com> 
02/09/2007 02:16 PM
Please respond to
tuscany-user@ws.apache.org


To
tuscany-user tuscany-user <tu...@ws.apache.org>
cc

Subject
public static boolean SDOUtil.isNillable(Property property) 
implementation?






Greetings,

I need a way to determine if an SDO property is nillable. I suspect EMF 
APIs are required to implement such a method but it isn't obvious to me 
how to use EMF to do it? Would a static method SDOUtil.isNillable(Property 
property) be an appropriate place to implement such a method? Any 
suggestions for an implementation?

Regards,

- Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org