com.abubusoft.kripton.android.annotation.BindContentProviderPath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kripton-orm Show documentation
Show all versions of kripton-orm Show documentation
Kripton Persistence Library - ORM module
The newest version!
/*******************************************************************************
* Copyright 2015, 2017 Francesco Benincasa ([email protected]).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.abubusoft.kripton.android.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* Used to generate a content provider path for the annotated data source. This
* annotation can be used only on a DAO definition.
*
*
* Attributes
*
* - path: define the segment path associated with DAO.
* - typeName: name of type that content provider returns. If
* not specified, a class name with authority
*
*
* Usage
*
* As stated before, this annotation can be used only on a DAO method's
* interface. A DAO interface that uses this annotation:
*
*
*
* @BindContentProviderPath(path = "cheese")
* @BindDao(Cheese.class)
* public interface CheeseDao {
*
* @BindSqlSelect(fields = "count(*)")
* int count();
*
* @BindContentProviderEntry
* @BindSqlInsert
* long insert(Cheese cheese);
*
* @BindContentProviderEntry()
* @BindSqlSelect
* List<Cheese> selectAll();
*
* @BindContentProviderEntry(path = "${id}")
* @BindSqlSelect(where = "id=${id}")
* Cheese selectById(long id);
*
* @BindContentProviderEntry(path = "${id}")
* @BindSqlDelete(where = "id=${id}")
* int deleteById(long id);
*
* @BindContentProviderEntry(path = "${cheese.id}")
* @BindSqlUpdate(where = "id=${cheese.id}")
* int update(Cheese cheese);
* }
*
*
* @author Francesco Benincasa ([email protected])
*
* @see content-provider-basics
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface BindContentProviderPath {
/**
* Define the segment path associated to DAO.
*
* @return content provider authority
*/
public String path();
/**
* Name of type that content provider returns. If not specified, class name
* with authority will be used.
*
* @return type name
*/
public String typeName() default "";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy