I have a column in the database that looks like "country / province / city", e.g. "Canada / Ontario / Toronto". I need to split them and map them into 3 different Java-Bean properties.
I wonder what is the best to do this?
(1) Recover DAO as rows (2) Sets are called domains (bean) (3) A SQL function, to parse the rows in the query (4) ResultSetExtractor Usage
I'm leaning towards # 2 or # 4 from "anemic" domain "anti-pattern indicates that bean is a suitable place for it. < P>
IMHO, the best place to do this is the database. I will split it into 3 columns, and I will store an information by column.
If this is not really an option for the reasons for heritage, then I actually do it in the domain object This is the behavior that can be explained directly in the domain object without any effect on other entities.
Comments
Post a Comment