本文整理汇总了Java中com.afollestad.inquiry.annotations.Column类的典型用法代码示例。如果您正苦于以下问题:Java Column类的具体用法?Java Column怎么用?Java Column使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Column类属于com.afollestad.inquiry.annotations包,在下文中一共展示了Column类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getIdDelegate
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Nullable
FieldDelegate getIdDelegate(Class<?> forClass) {
FieldDelegate idProxy = getIdProxyCache().get(forClass.getName());
if (idProxy != null) return idProxy;
Class<?> builderCls = getBuilderClass(forClass);
List<FieldDelegate> allProxiesList = classFieldDelegates(forClass, false, builderCls);
for (FieldDelegate proxy : allProxiesList) {
if (proxy.isId()) {
Column columnAnnotation = proxy.getColumn();
if (!columnAnnotation.autoIncrement() || !columnAnnotation.primaryKey())
throw new IllegalStateException(
"Columns which represent _id columns MUST have autoIncrement() AND primaryKey() enabled.");
if (proxy.getType() != Long.class && proxy.getType() != long.class)
throw new IllegalStateException(
"Columns which represent _id columns MUST be of type Long.");
idProxy = proxy;
}
}
if (idProxy == null) {
return null;
}
getIdProxyCache().put(forClass.getName(), idProxy);
return idProxy;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:27,代码来源:Inquiry.java
示例2: getColumn
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
public Column getColumn() {
if (getterMethod != null) {
return getterMethod.getAnnotation(Column.class);
} else {
return field.getAnnotation(Column.class);
}
}
开发者ID:afollestad,项目名称:inquiry,代码行数:9,代码来源:FieldDelegate.java
示例3: schema
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Nullable
String schema() {
if (isForeignKey()) return null;
else if (ignore()) return null;
Column columnAnnotation = getColumn();
StringBuilder colName = new StringBuilder(name());
colName.append(" ");
colName.append(getClassTypeString(getType()));
if (columnAnnotation.primaryKey()) colName.append(" PRIMARY KEY");
if (columnAnnotation.autoIncrement()) colName.append(" AUTOINCREMENT");
if (columnAnnotation.notNull()) colName.append(" NOT NULL");
return colName.toString();
}
开发者ID:afollestad,项目名称:inquiry,代码行数:14,代码来源:FieldDelegate.java
示例4: id
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column(autoIncrement = true, name = "_id", primaryKey = true)
public abstract long id();
开发者ID:afollestad,项目名称:inquiry,代码行数:3,代码来源:AutoValueRow.java
示例5: username
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public abstract String username();
开发者ID:afollestad,项目名称:inquiry,代码行数:3,代码来源:AutoValueRow.java
示例6: age
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public abstract int age();
开发者ID:afollestad,项目名称:inquiry,代码行数:3,代码来源:AutoValueRow.java
示例7: online
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public abstract boolean online();
开发者ID:afollestad,项目名称:inquiry,代码行数:3,代码来源:AutoValueRow.java
示例8: rank
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public abstract float rank();
开发者ID:afollestad,项目名称:inquiry,代码行数:3,代码来源:AutoValueRow.java
示例9: id
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column(autoIncrement = true, name = "_id", primaryKey = true)
public long id() {
return id;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:5,代码来源:BuilderRow.java
示例10: username
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public String username() {
return username;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:5,代码来源:BuilderRow.java
示例11: age
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public int age() {
return age;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:5,代码来源:BuilderRow.java
示例12: online
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public boolean online() {
return online;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:5,代码来源:BuilderRow.java
示例13: rank
import com.afollestad.inquiry.annotations.Column; //导入依赖的package包/类
@Column
public float rank() {
return rank;
}
开发者ID:afollestad,项目名称:inquiry,代码行数:5,代码来源:BuilderRow.java
注:本文中的com.afollestad.inquiry.annotations.Column类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论