Unique values for combination of columns in Hybris Impex Files
Asked Answered
M

2

7

I'm creating a Hybris impex file to import into my Database.

I want to perform an INSERT_UPDATE action with the data from the file, so I need to tell Hybris which column(s) need to be unique, so that it knows when to update a record instead of insert it.

I know that to tell Hybris that a certain column needs to be unique I can add the unique attribute to that column, like this:

INSERT_UPDATE SLEmployee;Firstname[unique=true, required=true];Lastname[required=true];Function;

But on my example above, how do I tell Hybris that the combination of the columns Firstname + Lastname must be unique?

Margueritamarguerite answered 3/10, 2012 at 12:10 Comment(1)
Have a look at this - #71546600Gribble
G
15
> how do I tell Hybris that the combination of the 
> columns Firstname + Lastname must be unique?

Add the unique keyword to every field that is part of the combined key

 INSERT_UPDATE SLEmployee;Firstname[unique=true];Lastname[unique=true];Function;
Goatherd answered 17/10, 2012 at 5:13 Comment(1)
exactly this. you can just add multiple unique attributes to a field and hybris will make sure it matches them all.Homorganic
M
0

While creating attributes in itemtype, make sure unique modifier is set true for all the attributes you want to be considered for the combination. Prepare data accordingly.

Metalwork answered 22/8, 2018 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.