1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.gallery3d.common;
18
19import java.lang.annotation.ElementType;
20import java.lang.annotation.Retention;
21import java.lang.annotation.RetentionPolicy;
22import java.lang.annotation.Target;
23
24public abstract class Entry {
25    public static final String[] ID_PROJECTION = { "_id" };
26
27    public static interface Columns {
28        public static final String ID = "_id";
29    }
30
31    // The primary key of the entry.
32    @Column("_id")
33    public long id = 0;
34
35    @Retention(RetentionPolicy.RUNTIME)
36    @Target(ElementType.TYPE)
37    public @interface Table {
38        String value();
39    }
40
41    @Retention(RetentionPolicy.RUNTIME)
42    @Target(ElementType.FIELD)
43    public @interface Column {
44        String value();
45
46        boolean indexed() default false;
47
48        boolean fullText() default false;
49
50        String defaultValue() default "";
51
52        boolean unique() default false;
53    }
54
55    public void clear() {
56        id = 0;
57    }
58}
59