cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Query to get all the available object types within a selected context in Windchill

aachanta
13-Aquamarine

Query to get all the available object types within a selected context in Windchill

Hi All,

 

I just need to write a query to get all the available object types within a selected context.

 

Can you please let me know how to query the same and to which tables in Windchill should I be viewing to write that query ?

 

Can anyone please let me know about it ?

 

Thanks and Regards,

Aditya

1 ACCEPTED SOLUTION

Accepted Solutions

1. You won't be able to write a direct SQL query to retrieve all the Object Types unless you write select * and do a union of all tables.

2. I would highly recommend a Java Program as follows, You can pass the Container Name as an argument in the method, You can create a little utility which can output an excel report based on the Container you provide on the command line, Let me know if you need more help with that.

QuerySpec qs = new QuerySpec(WTContained.class);
QueryResult allContained=PersistenceHelper.manager.find((StatementSpec)qs);

while(allContained.hasMoreElements())
{
WTContained obj=(WTContained) allContained.nextElement();

//logger.debug("-Business Object is instance of WTContained -");

WTContainer container = obj.getContainer();
}

View solution in original post

3 REPLIES 3
aachanta
13-Aquamarine
(To:aachanta)

Hi All, Kindly let me know any leads or inputs on the same. Thanks and Regards, Aditya

1. You won't be able to write a direct SQL query to retrieve all the Object Types unless you write select * and do a union of all tables.

2. I would highly recommend a Java Program as follows, You can pass the Container Name as an argument in the method, You can create a little utility which can output an excel report based on the Container you provide on the command line, Let me know if you need more help with that.

QuerySpec qs = new QuerySpec(WTContained.class);
QueryResult allContained=PersistenceHelper.manager.find((StatementSpec)qs);

while(allContained.hasMoreElements())
{
WTContained obj=(WTContained) allContained.nextElement();

//logger.debug("-Business Object is instance of WTContained -");

WTContainer container = obj.getContainer();
}

aachanta
13-Aquamarine
(To:abhishekarya)

Thank you Aarya.
Top Tags