Can an Enum table in the database store more than one value for the same element?

Asked

Viewed 14 times

-2

public enum SitucaoEnum { INCLUSAO(1), CANCELAMENTO(2), ATUALIZACAO(3), FINALIZACAO(4); }

Can I save more than one such value in a type Enum column in the database? Or only rescue of one Enum per element is permitted?

1 answer

0

If you use common database types, such as int, string, and so on, you can only save one value per column. To write more than one value, you would have to use advanced types like json, but in this case you would need to implement an Enum to the database type, other than other settings. The ideal is to use an Enum list on the parent object, so simply map as a list.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.