Skip to main content
added 76 characters in body
Source Link
Martin Zeitler
  • 79.6k
  • 20
  • 170
  • 244

You mustshould define that enum with constant values,
then then the values won't be instanceof something (maybe it doesn't like the enumeration for some other reason, but it still reads no enum constant).

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

And @Enumerated probably should then be EnumType.ORDINAL:

@Enumerated(EnumType.ORDINAL) @Column(name = "status") 

You must define that enum with constant values,
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

And @Enumerated probably should be EnumType.ORDINAL:

@Enumerated(EnumType.ORDINAL) @Column(name = "status") 

You should define that enum with constant values, then the values won't be instanceof something (maybe it doesn't like the enumeration for some other reason, but it still reads no enum constant).

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

And @Enumerated should then be EnumType.ORDINAL:

@Enumerated(EnumType.ORDINAL) @Column(name = "status") 
added 4 characters in body
Source Link
Martin Zeitler
  • 79.6k
  • 20
  • 170
  • 244

You must define that enum with constant values,
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

And @Enumerated canprobably should be either String or int (depending on the enumEnumType.ORDINAL):

@Enumerated(EnumType.intORDINAL) @Column(name = "status") 

You must define that enum with constant values,
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

@Enumerated can be either String or int (depending on the enum):

@Enumerated(EnumType.int) @Column(name = "status") 

You must define that enum with constant values,
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

And @Enumerated probably should be EnumType.ORDINAL:

@Enumerated(EnumType.ORDINAL) @Column(name = "status") 
added 4 characters in body
Source Link
Martin Zeitler
  • 79.6k
  • 20
  • 170
  • 244

You must define that enum with constant values, then
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

@Enumerated can be either String or int (depending on the enum):

@Enumerated(EnumType.int) @Column(name = "status") 

You must define that enum with constant values, then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

You must define that enum with constant values,
then the values won't be instanceof something.

public static final int STATUS_ACTIVE = 0; public static final int STATUS_ONBOARDING = 1; public static final int STATUS_NOT_VERIFIED = 2; public static final int STATUS_VERIFIED = 3; public static final int STATUS_SUSPENDED = 4; public static final int STATUS_INACTIVE = 5; public enum BusinessCustomersStatus { STATUS_ACTIVE, STATUS_ONBOARDING, STATUS_NOT_VERIFIED, STATUS_VERIFIED, STATUS_SUSPENDED, STATUS_INACTIVE } 

@Enumerated can be either String or int (depending on the enum):

@Enumerated(EnumType.int) @Column(name = "status") 
Source Link
Martin Zeitler
  • 79.6k
  • 20
  • 170
  • 244
Loading