@AnnotateWithãã¡ã¿ã¢ããã¼ã·ã§ã³ã¨ãã¦ä½¿ç¨å¯è½ã«
@AnnotateWithã¨ããã¢ããã¼ã·ã§ã³ã使ãã¨ãaptã§çæãããå®è£ ã¯ã©ã¹ã®ç¹å®ã®ç®æã«ä»»æã®ã¢ããã¼ã·ã§ã³ãã¤ãããã¾ããããã¯è¨å®ã¯ã©ã¹ãDaoã«DIããããã«ä½¿ç¨ãã¾ããGuiceã®ã¢ããã¼ã·ã§ã³ãã¤ããå ´åã®ä¾ã¯ãããªã§ãã
@Dao @AnnotateWith(annotations = { @Annotation(target = AnnotationTarget.CONSTRUCTOR, type = Inject.class), @Annotation(target = AnnotationTarget.CONSTRUCTOR_PARAMETER, type = Named.class, elements = "\"sales\"") }) public interface EmployeeDao { ... }
ããã¾ã§@AnnotateWithãDaoãã¨ã«æå®ããªããã°ããã¾ããã§ãããã次ã®ãã¼ã¸ã§ã³ï¼1.0.0-RC3ï¼ããã¯ãå¥ã®ä»»æã®ã¢ããã¼ã·ã§ã³ã«@AnnotateWithãè¨è¿°ãã¦ããã¦ãDaoã«ã¯ãã®ã¢ããã¼ã·ã§ã³ã使ç¨ã§ããããã«ãªãã¾ããé常ã¯ã©ã®Daoã«ãä¸å¾åãã¢ããã¼ã·ã§ã³ã注éãããã¯ãã§ãã®ã§æéãçããã¨æãã¾ãã
ãã¨ãã°ãInjectConfigã¨ããã¢ããã¼ã·ã§ã³ãä½ã£ã¦ããã«@AnnotateWithã注éãã¾ããã¢ããã¼ã·ã§ã³ã«ã¢ããã¼ã·ã§ã³ã注éãããããããã¡ã¿ã¢ããã¼ã·ã§ã³ã§ãã
@AnnotateWith(annotations = { @Annotation(target = AnnotationTarget.CONSTRUCTOR, type = Inject.class), @Annotation(target = AnnotationTarget.CONSTRUCTOR_PARAMETER, type = Named.class, elements = "\"sales\"") }) public @interface InjectConfig { ... }
次ã®ããã«ä½¿ãã¾ãã
@Dao @InjectConfig public interface EmployeeDao { ... }
@Dao @InjectConfig public interface DepartmentDao { ... }
å¹æã¯@AnnotateWithãç´æ¥Daoã«æ³¨éãã¦ããå ´åã¨åãã§ãããã¨@AnnotateWithã使ã£ãå ´åã¯ã@Daoã®configè¦ç´ ã®æå®ãçç¥ã§ããããã«ãªã£ã¦ãã¾ãã
SNAPSHOTä½æããã®ã§ããã£ãã使ã£ã¦ãã ããã
http://maven.seasar.org/maven2-snapshot/org/seasar/doma/doma/1.0.0-RC3-SNAPSHOT/doma-1.0.0-RC3-20100130.043940-1.jar
1.0.0-RC2ããã®å¤æ´ç¹ã¯æ¬¡ã®ã¨ããã§ãã
Improvement
- [DOMA-128] - [Core] ãã¡ã¤ã³ã¯ã©ã¹ãã¨ã³ãã£ãã£ã¯ã©ã¹ãDaoã¤ã³ã¿ãã§ã¼ã¹ãããã±ã¼ã¸ãã©ã¤ãã¼ãã®å¯è¦æ§ã§å®ç¾©ã§ããããã«ãã¾ããã
- [DOMA-129] - [Core] aptã§çæãããã¨ã³ãã£ãã£ã¯ã©ã¹ã¨ãã¡ã¤ã³ã¯ã©ã¹ã®ã¡ã¿ã¯ã©ã¹ã®getã¡ã½ããã®ååãgetSingletonInternalã«å¤æ´ãã¾ããã
- [DOMA-130] - [Core] @AnnotateWithãä»»æã®ã¢ããã¼ã·ã§ã³Xã«æ³¨éå¯è½ã¨ããXãDaoã«æ³¨éããã¦ããã°Daoã«ç´æ¥@AnnotateWithã注éããã¦ããå ´åã¨åãæåã«ãã¾ããã
- [DOMA-131] - [Core] @Entityã®listenerè¦ç´ ã«æå®ãããã¯ã©ã¹ãæ½è±¡åãããã¯ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ãæããªãå ´åã«aptã§ã¨ã©ã¼ã¨ãã¾ããã
- [DOMA-132] - [Core] @SequenceGeneratorã®implementerè¦ç´ ã«æå®ãããã¯ã©ã¹ãæ½è±¡åãããã¯ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ãæããªãå ´åã«aptã§ã¨ã©ã¼ã¨ãã¾ããã
- [DOMA-133] - [Core] @TableGeneratorã®implementerè¦ç´ ã«æå®ãããã¯ã©ã¹ãæ½è±¡åãããã¯ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ãæããªãå ´åã«aptã§ã¨ã©ã¼ã¨ãã¾ããã