Unique two-column constraint Combination in active objects

I am developing Active Objects and have 4 columns in my table. I have a requirement where I need to set a constraint so that the combination of two columns is always unique.

public interface TestEntity extends RawEntity<Long>{

Long getID();

Long getItemId();

String getItemName();

String getDescription();

void setItemId(Long itemId);

void setItemName(String itemName);

void setDescription(String description);


The requirement here is that the combination of ItemId and ItemName must have a unique constraint.

I tried to do some searches but was able to find a way to make the single column unique using the net.java.ao.schema.Unique class.

Can anyone point me in the right direction on how this can be achieved.



source to share

1 answer

After some research, I found that Active Objects does not currently support this particular feature. Therefore, if you want to use it badly, you may have to change your approach to data storage.



All Articles