Created
April 9, 2013 11:46
-
-
Save mrmike/5345057 to your computer and use it in GitHub Desktop.
Eclipse template for creating database table in AUContentProvider library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add this template in Preferences > Java > Editor > Templates > New | |
| // I stored this snippet with newTable name, but you can use any name you want | |
| public static class ${tableName} implements BaseColumns { | |
| public static final String CONTENT_PATH = ${name}; | |
| public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, CONTENT_PATH); | |
| public static final String CONTENT_ITEM_TYPE = DataHelper.contentItemType(AUTHORITY, CONTENT_PATH); | |
| public static final String CONTENT_DIR_TYPE = DataHelper.contentType(AUTHORITY, CONTENT_PATH); | |
| static final String DB_TABLE = CONTENT_PATH; | |
| public static final String ${table_name}_ID = DataHelper.field(DB_TABLE, _ID); | |
| public static final String GUID = DataHelper.field(DB_TABLE, "guid"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment