2

In hybris, I have Created ArchivalOrderModel extends orderModel

Moved Data from OrderModel To ArchivalOrderModel. (Deleted Record from OrderModel)

When I fired query

select {pk} from {order}

In result Im getting Records of ArchivalOrderModel too.

Is there any way to restrict with help of data Modeling definition or Any other suggestion for archival

HybrisHelp
  • 5,518
  • 2
  • 27
  • 65

1 Answers1

7

When we search any type, by default its subtypes will also be retrieved in the result.

If you want to exclude the subtype, you must use the exclamation mark (!) while specifying the type in the query like this.

Select * from {Order!}
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
  • Thanks very much. Do we have any option with restriction in data modeling – Manigandan Karthick Feb 18 '20 at 09:39
  • Could you please elaborate on your question? when you say "restriction in data modeling", what you want to achieve? – HybrisHelp Feb 24 '20 at 04:48
  • If you want to separate the ArchivalOrder instances into another table, then you would need to create a new type inheriting from AbstractOrder rather than from Order. Then you would need to define a deployment table for that new type. Note: you also then need to define a new child type of AbstractOrderEntry (plus deployment table). – Neil Hubert-Price Mar 03 '20 at 16:18