@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) @Documented @Inherited public @interface Dao
Dao implemention into RepositoryManager.Dao注入RepositoryManager.DaoAnnotationBeanPostProcessor bean in your spring context.DaoAnnotationBeanPostProcessor bean 就可以了.
@Dao(value = Entity.class, name = "customDao")
public DaoRepository<Entity> entityDao;
DaoManager may also create the same name DaoRepository, and @Dao can't assure instantiation order
of DaoRepository, please use carefully.DaoManager也有可能建立同名的DaoRepository,而@Dao並無法保證其建立順序,所以要用時,
請自求多福。| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
autoRegister
|
String |
factory
Deinfe
EntityManagerFactory bean's name. |
String |
name
Naming object to be turned into a Spring bean in case of an autodetected component.
|
Class |
value
Class assoicated with
DaoRepository. |
public abstract String factory
EntityManagerFactory bean's name, default is "entityManagerFactory"public abstract boolean autoRegister
value's simple class name suffix with "Dao" if not assigned $name.name,則自動以$value的類別名稱加上"Dao"註冊Copyright © 2020. All rights reserved.