views:

19

answers:

0

I'm being forced to use code values for on-going projects and can't seem to find a good, eloquent solution besides brute force lookups for every code value. Are there any good libraries anyone can suggest, or any good design patterns to retrieve/swap code values?

FWIW, I'm in a Spring/Hibernate shop. I had been using a @Codified annotation with an AOP interceptor. I'd like something that's not invasive or requires a ton of explicit DAO/Service hits. Ideally the solution would reside in the DAO/Service layer.

Example:

Code Set

  • 100
  • Status

Code Value

  • codeset = 100
  • code value 101
  • cdf = SUCCESS

public class Entity { long statusCd; // other stuff }

entity.setStatusCd(CodeValueDao.findCodeValue(codeset, cdfMeaning));

Are code values even worth it?