Annotation Interface Dao


@Target(TYPE) @Retention(RUNTIME) public @interface Dao
Indicates a DAO interface.

The annotated interface must be a top level interface.

 @Dao
 public interface EmployeeDao {

     @Insert
     int insert(Employee employee);
 }
 

The interface can extend another DAO interface:

 @Dao
 public interface WorkerDao {

     @Insert
     int insert(Worker worker);
 }
 
 @Dao
 public interface EmployeeDao extends WorkerDao {

     @Insert
     int insert(Employee employee);
 }
 
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • accessLevel

      AccessLevel accessLevel
      Returns:
      the access level that should be used for the generated DAO implementation class.
      Default:
      PUBLIC