You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Venkata Krishnan <fo...@gmail.com> on 2006/07/11 15:38:26 UTC

Getting SDO Type instance using the interface class of an SDO

Hi
   I want to get hold of the SDO.Type given the class of the SDO Type.  For
example given com.examples.sdo.Customer.class I need to get the Type
instance to work around with the SDOs metadata.  Presently I am
instantiating the SDO and then calling the getType() method.

I checked the TypeHelper class for some APIs and there is one called
getType(Class) but that returns only the Type for standard SDO types.  Am I
missing something here ?

Thanks.

- Venkat

Re: Getting SDO Type instance using the interface class of an SDO

Posted by Frank Budinsky <fr...@ca.ibm.com>.
TypeHelper.getType(Class) will return the type for the standard types and 
any "registered" generated SDO.

For example, after you register the quote model (example model from the 
sdo.tools project):

      SDOUtil.registerStaticTypes(SimpleFactory.class);

You can then call:

      Type quoteType = TypeHelper.INSTANCE.getType(Quote.class);
      System.out.println("quoteType: " + quoteType);

Which will print the following:

quoteType: org.apache.tuscany.sdo.impl.ClassImpl@13ad085 (name: Quote) 
(instanceClassName: null) (abstract: false, interface: false)

Frank

"Venkata Krishnan" <fo...@gmail.com> wrote on 07/11/2006 09:38:26 
AM:

> Hi
>    I want to get hold of the SDO.Type given the class of the SDO Type. 
For
> example given com.examples.sdo.Customer.class I need to get the Type
> instance to work around with the SDOs metadata.  Presently I am
> instantiating the SDO and then calling the getType() method.
> 
> I checked the TypeHelper class for some APIs and there is one called
> getType(Class) but that returns only the Type for standard SDO types. Am 
I
> missing something here ?
> 
> Thanks.
> 
> - Venkat


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