problem description
now the test information of the sample stored in a table of data has the following fields
tableA
id, description, status, type, createDate
then status has pass corresponding code 1; fail corresponding code 2; inprogress object code 3
type also has different categories such as smoke corresponding code; 11 full corresponding code 12.
when I designed tableA, status type stored the corresponding code for the int type
my consideration now is:
now do you need to create corresponding status type tables and associate them with tableA? Then when inserting data on the java server, for status and type, you want to represent the incoming method
by enumerating types, such as TypeEnum {smoke (11), full (12)}
, so you need to define the enumeration class corresponding to status type on the service side. Is it necessary to db to create the status type table? if so, if status changes later, you need to modify both the database table and the enumeration class
or db does not need to create the corresponding status type table, just create the corresponding enumeration class in the service section. This can also meet the requirements.
Don"t you know if the Great God has any good suggestions?