How do I restrict insert in Hybris?

2019-09-21 23:03发布

Like I know, I can use SearchRestrictions to restrict get operations. But what about insert_update? For instance, I want to remove an opportunity to insert Products with CHECK approvalStatus.

标签: hybris
1条回答
Rolldiameter
2楼-- · 2019-09-21 23:29

Search restrictions don't work like that. They restrict queries that are made against the database. How? The condition you add to a search restriction is added to the where clause of the select statement of the query. An INSERT query does not have a where clause. At least not those, that are generated when using impex.

Also impex is not the right tool for your purpose. Impex should only be used to import flawless data. It is just a simpler way of inserting data into a database, just like an insert statement in sql. You don't want data in an impex file that needs further checks.

Just filter those lines, that have undesired values. Then you can import the rest.

查看更多
登录 后发表回答