Skip to content

Most visited

Recently visited

navigation

Dao

public abstract @interface Dao
implements Annotation

android.arch.persistence.room.Dao


Marks the class as a Data Access Object.

Data Access Objects are the main classes where you define your database interactions. They can include a variety of query methods.

The class marked with @Dao should either be an interface or an abstract class. At compile time, Room will generate an implementation of this class when it is referenced by a Database.

An abstract @Dao class can optionally have a constructor that takes a Database as its only parameter.

It is recommended to have multiple Dao classes in your codebase depending on the tables they touch.

See also:

Summary

Inherited methods

From interface java.lang.annotation.Annotation
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)