本文整理匯總了Java中org.seasar.doma.Transient類的典型用法代碼示例。如果您正苦於以下問題:Java Transient類的具體用法?Java Transient怎麽用?Java Transient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Transient類屬於org.seasar.doma包,在下文中一共展示了Transient類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doFieldElements
import org.seasar.doma.Transient; //導入依賴的package包/類
public void doFieldElements(TypeElement classElement,
EntityMeta entityMeta) {
for (VariableElement fieldElement : getFieldElements(classElement)) {
try {
if (fieldElement.getAnnotation(Transient.class) != null) {
continue;
} else if (fieldElement.getModifiers().contains(
Modifier.STATIC)) {
continue;
} else if (fieldElement.getAnnotation(OriginalStates.class) != null) {
doOriginalStatesField(classElement, fieldElement,
entityMeta);
} else {
doEntityPropertyMeta(classElement, fieldElement,
entityMeta);
}
} catch (AptException e) {
Notifier.notify(env, e);
entityMeta.setError(true);
}
}
}
示例2: doImportName
import org.seasar.doma.Transient; //導入依賴的package包/類
@Override
protected void doImportName(final EntityModel model, final EntityDesc entityDesc) {
classModelSupport.addImportName(model, Entity.class);
classModelSupport.addImportName(model, Serializable.class);
classModelSupport.addImportName(model, Generated.class);
if (model.getCatalogName() != null || model.getSchemaName() != null
|| model.getTableName() != null) {
classModelSupport.addImportName(model, Table.class);
}
if (superclass != null) {
classModelSupport.addImportName(model, superclass);
}
for (AttributeModel attr : model.getAttributeModelList()) {
if (attr.isId()) {
classModelSupport.addImportName(model, Id.class);
if (attr.getGenerationType() != null) {
classModelSupport
.addImportName(model, GeneratedValue.class);
classModelSupport
.addImportName(model, GenerationType.class);
if (attr.getGenerationType() == javax.persistence.GenerationType.SEQUENCE) {
classModelSupport.addImportName(model,
SequenceGenerator.class);
} else if (attr.getGenerationType() == javax.persistence.GenerationType.TABLE) {
classModelSupport.addImportName(model,
TableGenerator.class);
}
}
}
if (attr.isTransient()) {
classModelSupport.addImportName(model, Transient.class);
} else {
classModelSupport.addImportName(model, Column.class);
}
if (attr.isVersion()) {
classModelSupport.addImportName(model, Version.class);
}
classModelSupport.addImportName(model, attr.getAttributeClass());
}
}
示例3: getSuperclassEntityPropertyInfo
import org.seasar.doma.Transient; //導入依賴的package包/類
/**
* スーパークラスに定義されたエンティティプロパティの情報のセットを返します。
*
* @return スーパークラスに定義されたエンティティプロパティの情報のセット
* @since 1.7.0
*/
protected Set<EntityPropertyInfo> getSuperclassEntityPropertyInfo() {
Set<EntityPropertyInfo> results = new HashSet<EntityPropertyInfo>();
if (superclass == null) {
return results;
}
for (Class<?> clazz = superclass; clazz != Object.class; clazz = clazz
.getSuperclass()) {
Entity entity = clazz.getAnnotation(Entity.class);
if (entity == null) {
continue;
}
org.seasar.doma.jdbc.entity.NamingType namingType = entity.naming();
for (Field field : clazz.getDeclaredFields()) {
int m = field.getModifiers();
if (Modifier.isStatic(m)) {
continue;
}
if (field.isAnnotationPresent(Transient.class)) {
continue;
}
EntityPropertyInfo propertyInfo = new EntityPropertyInfo();
propertyInfo.entityClass = clazz;
propertyInfo.propertyField = field;
Column column = field.getAnnotation(Column.class);
propertyInfo.column = column;
if (column == null || column.name().isEmpty()) {
propertyInfo.columnName = namingType.apply(field.getName())
.toLowerCase();
} else {
propertyInfo.columnName = column.name();
}
propertyInfo.id = field.getAnnotation(Id.class);
propertyInfo.generatedValue = field
.getAnnotation(GeneratedValue.class);
propertyInfo.sequenceGenerator = field
.getAnnotation(SequenceGenerator.class);
propertyInfo.tableGenerator = field
.getAnnotation(TableGenerator.class);
propertyInfo.version = field.getAnnotation(Version.class);
results.add(propertyInfo);
}
}
return results;
}
示例4: doFieldElements
import org.seasar.doma.Transient; //導入依賴的package包/類
@Override
public void doFieldElements(TypeElement embeddableElement,
EmbeddableMeta embeddableMeta) {
for (VariableElement fieldElement : getFieldElements(embeddableElement)) {
try {
if (fieldElement.getAnnotation(Transient.class) != null) {
continue;
} else if (fieldElement.getModifiers().contains(
Modifier.STATIC)) {
continue;
} else if (fieldElement.getAnnotation(OriginalStates.class) != null) {
throw new AptException(Message.DOMA4286, env,
fieldElement, new Object[] {
embeddableElement.getQualifiedName(),
fieldElement.getSimpleName() });
} else if (fieldElement.getAnnotation(Id.class) != null) {
throw new AptException(Message.DOMA4289, env,
fieldElement, new Object[] {
embeddableElement.getQualifiedName(),
fieldElement.getSimpleName() });
} else if (fieldElement.getAnnotation(Version.class) != null) {
throw new AptException(Message.DOMA4290, env,
fieldElement, new Object[] {
embeddableElement.getQualifiedName(),
fieldElement.getSimpleName() });
} else if (fieldElement.getAnnotation(TenantId.class) != null) {
throw new AptException(Message.DOMA4443, env,
fieldElement, new Object[] {
embeddableElement.getQualifiedName(),
fieldElement.getSimpleName() });
} else if (fieldElement.getAnnotation(GeneratedValue.class) != null) {
throw new AptException(Message.DOMA4291, env,
fieldElement, new Object[] {
embeddableElement.getQualifiedName(),
fieldElement.getSimpleName() });
} else {
doEmbeddablePropertyMeta(fieldElement, embeddableMeta);
}
} catch (AptException e) {
Notifier.notify(env, e);
embeddableMeta.setError(true);
}
}
}
示例5: isPersistent
import org.seasar.doma.Transient; //導入依賴的package包/類
protected boolean isPersistent(VariableElement field) {
return field.getAnnotation(Transient.class) == null
&& !field.getModifiers().contains(Modifier.STATIC);
}