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

Why we need to give both 'deployment table' and 'typecode' while declaring any item type?

Huskar
Participant
0 Likes
2,632

When we declare any item type we either give values to both attribute 'deployment table' and 'typecode' or none of these two. Why? I mean why can't we just give 'deployment table' only and hybris can auto handle typecode.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

deployment table is the name of table in DB and typecode is like an identifier (not necessarily) of a row in that particular table

for example both ProductModel and VariantProductModel are saved in a DB table called 'products'. so when you fetch a product, the flexible query select {pk} from {Product} would be translated to select item_0.pk from products where item_0.typecode = 'product'
when you fetch a variant the same query gets translated into select item_0.pk from products where item_0.typecode = 'variantproduct'

Former Member
0 Likes

Hi ï¼ Krishn,

I am agree with your point, but think this way, When Hybris will generate the typecode? Spring incremental functionality only works after server is up.

Typecode can not be allocated in run time or while server is being up.

Please do let me know about your thought here.

Thanks, Niket

arvind-kumar_avinash
Active Contributor
0 Likes

I know that you already know the purpose of deployment table and typecode. For the sake of lucidness, let me say it like what a hostname is to an IP address, a deployment table is to a typecode.

Systems can always be designed to generate IP addresses but many a time, it is left to the user to create one as per his/her convenience. Similar is the case with typecode. Many a time, we like to maintain a range of typecodes e.g. in your project, you may decide to keep typecode n to m for a module x and typecode p to q for the module y. Giving the control to the developer to provide a typecode manually justifies this case.