数据小助手:chenzx.dataassistant.db.NoteColumn设计

首先实现便签功能,密码箱、待办记录稍后完成。

便签表设计:

表名:note

字段:_id,title,content,create_time(建立时间),visiable(是否显示,1是,0否)

SQL:create table note( _id integer primary key autoincrement,title text,content text,ctime text,visiable integer)

NoteColumn代码:

package chenzx.dataassistant.db;

import java.util.HashMap;
import java.util.Map;

import android.net.Uri;

/**
 * 便签类。用于定义建立note表及其它与nota表有关的操作
 * @author chenzx
 *
 */
public class NoteColumn extends DatabaseColumn {

	public static final String TABLE_NAME="note";
	public static final String TITLE="title";
	public static final String CONTENT="content";
	public static final String VISIABLE="visiable";
	public static final String CREATE_TIME="create_time";
	
	/**
	 * 表Uri
	 */
	public static final Uri CONTENT_URI	=Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
	
	/**
	 * 表结构
	 */
	private static final Map
   
   
    
     mColumnMap = new HashMap
    
    
     
     ();
	 
	/**
	 * 表结构生成
	 */
	static {
		 
		 mColumnMap.put(_ID, "integer primary key autoincrement");
		 mColumnMap.put(TITLE, "text not null");
		 mColumnMap.put(CONTENT, "text not null");
		 mColumnMap.put(VISIABLE, "integer not null");
		 mColumnMap.put(CREATE_TIME, "localtime");
		 
	 }
	
	/**
	 * @retrun 表名
	 */
	@Override
	public String getTableName() {
		// TODO Auto-generated method stub
		return TABLE_NAME;
	}
	
	/**
	 * @return 返回建表uri
	 */
	@Override
	public Uri getTableContent() {
		// TODO Auto-generated method stub
		return CONTENT_URI;
	}
	/**
	 * @return 返回表结构映射
	 */
	@Override
	protected Map
     
     
      
       getTableMap() {
		// TODO Auto-generated method stub
		return mColumnMap;
	}
	 

}

     
     
    
    
   
   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值