Notifications
Clear all

API to get Column name and data type and description from model name

2 Posts
2 Users
0 Reactions
1,296 Views
0
Topic starter

Do we have any API to get Column name , data type and description from selected model name  . Say user selects "ITEM" then we want to populate all columns from item model in next "attributes" drop down. User can select any attribute and put required text input here . 

e.g. select all item which has STANDARD_COST greater than 20 USD

Requirment :  we are creating priority rules for an engine to process demands. We want to add rules on model attributes . I was searching if we have some API which will help in this process.

One way of doing could be with below query, but I am not sure about the permissions to read this data in other environments (UAT/PROD).

SELECT table_name, column_name, data_type, data_length

FROM USER_TAB_COLUMNS

WHERE table_name = 'ITEM';  

Can you please help me in this ?

isingh 2024-10-29 08:26:48
This post was modified 3 weeks ago 2 times by isingh

@kunalbadgujar do you want to do based on DB query or you want to get the information on the Java side?

 

If you need to do this on the DB side then use the ALL_TAB_COLUMNS instead of USER_TAB_COLUMNS and if you need to get the model attributes on the Java side then use the LevelMappingHelper, i.e.

 

LevelMappingHelper helper = LevelMappingHelper.get(Item.MODEL_LEVEL_TYPE);

helper getLevelChildMappingHelpers() will give you all the model attributes.
kunalbadgujar Topic starter 2024-10-29 09:14:43

@isingh , this is helpful. thanks