本文整理汇总了Java中javax.jdo.annotations.IdGeneratorStrategy类的典型用法代码示例。如果您正苦于以下问题:Java IdGeneratorStrategy类的具体用法?Java IdGeneratorStrategy怎么用?Java IdGeneratorStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdGeneratorStrategy类属于javax.jdo.annotations包,在下文中一共展示了IdGeneratorStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldSetIncrementStrategy
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
@Test
public void shouldSetIncrementStrategy() {
when(entity.getName()).thenReturn(ENTITY_NAME);
when(entity.getModule()).thenReturn(MODULE);
when(entity.getNamespace()).thenReturn(NAMESPACE);
when(entity.getTableName()).thenReturn(TABLE_NAME);
when(jdoMetadata.newPackageMetadata(PACKAGE)).thenReturn(packageMetadata);
when(packageMetadata.newClassMetadata(ENTITY_NAME)).thenReturn(classMetadata);
entityMetadataBuilder.addEntityMetadata(jdoMetadata, entity, SampleWithIncrementStrategy.class, schemaHolder);
verify(jdoMetadata).newPackageMetadata(PACKAGE);
verify(packageMetadata).newClassMetadata(ENTITY_NAME);
verify(classMetadata).setTable(TABLE_NAME_3);
verifyCommonClassMetadata(IdGeneratorStrategy.INCREMENT);
}
示例2: getIdGeneratorStrategy
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
private IdGeneratorStrategy getIdGeneratorStrategy(FieldMetadata fmd, Class<?> definition) {
java.lang.reflect.Field field = FieldUtils.getField(definition, fmd.getName(), true);
if (field != null) {
Persistent persistentAnnotation = ReflectionsUtil.getAnnotationSelfOrAccessor(field, Persistent.class);
if (persistentAnnotation != null && persistentAnnotation.valueStrategy() != null
&& !persistentAnnotation.valueStrategy().equals(IdGeneratorStrategy.UNSPECIFIED)) {
return persistentAnnotation.valueStrategy();
}
}
return IdGeneratorStrategy.NATIVE;
}
示例3: verifyCommonClassMetadata
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
private void verifyCommonClassMetadata(IdGeneratorStrategy expextedStrategy) {
verify(classMetadata).setDetachable(true);
verify(classMetadata).setIdentityType(IdentityType.APPLICATION);
verify(classMetadata).setPersistenceModifier(ClassPersistenceModifier.PERSISTENCE_CAPABLE);
verify(idMetadata).setPrimaryKey(true);
verify(idMetadata).setValueStrategy(expextedStrategy);
verify(inheritanceMetadata).setCustomStrategy("complete-table");
}
示例4: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene el numero de una nueva Factura, el cual se genera en forma
* automatica
*
* @return numero long
*/
@Title(prepend = "Factura Nº ")
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroFactura")
@Named("Número")
@TypicalLength(3)
@Disabled
@MemberOrder(sequence = "1")
@Column(allowsNull = "false")
public long getNumero() {
return numero;
}
示例5: getLegajo
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Retorna el legajo del Empleado que se va a crear.
* @return legajo long
*/
@TypicalLength(5)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaLegajo")
@MemberOrder(sequence = "1")
@Column(allowsNull = "false")
public long getLegajo() {
return legajo;
}
示例6: getNumeroCliente
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Retorna el numero de Cliente que se va a crear
*
* @return numeroCliente long
* @return long numeroCliente
*/
@TypicalLength(5)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroCliente")
@MemberOrder(sequence = "1")
@Column(allowsNull = "false")
public long getNumeroCliente() {
return numeroCliente;
}
示例7: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene el numero de un nuevo Menu que se
* generará de forma automática
* @return numero int
*/
@Hidden(where = Where.ALL_TABLES)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroMenu")
@TypicalLength(3)
@Disabled
@Column(allowsNull = "false")
@MemberOrder(sequence = "1")
public int getNumero() {
return numero;
}
示例8: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene el numero de una nueva comanda, el cual se genera en forma automatica
* @return numero int
*/
@Named("Número")
@TypicalLength(3)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroComanda")
@Disabled
@Column(allowsNull = "false")
@MemberOrder(sequence = "1")
public int getNumero() {
return numero;
}
示例9: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene un numero para la reserva
* @return numero int
*/
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroReserva")
@Hidden
@Named("Número")
@Disabled
@Title(prepend = "Reserva Nº ")
@MemberOrder(sequence = "1")
@Column(allowsNull = "false")
public int getNumero() {
return numero;
}
示例10: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene el numero de la Oferta
* @return numero int
*/
@Hidden(where = Where.ALL_TABLES)
@Named("Número")
@TypicalLength(3)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroOferta")
@Disabled
@Column(allowsNull = "false")
@MemberOrder(sequence = "1")
public int getNumero() {
return numero;
}
示例11: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene un numero para el Producto
* @return numero int
*/
@Hidden(where = Where.ALL_TABLES)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroProducto")
@Named("Número")
@TypicalLength(3)
@Disabled
@Column(allowsNull = "false")
@MemberOrder(sequence = "1")
public int getNumero() {
return numero;
}
示例12: getNumero
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
/**
* Obtiene un numero para el Pedido
* @return numero int
*/
@Hidden(where = Where.ALL_TABLES)
@Named("Número")
@TypicalLength(3)
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaNumeroPedido")
@Disabled
@Column(allowsNull = "false")
@MemberOrder(sequence = "1")
public int getNumero() {
return numero;
}
示例13: populate
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
public JDOMetadata populate(JDOMetadata md, String fullyQualifiedClassName, String fieldName) {
PackageMetadata pmd = md.newPackageMetadata(fullyQualifiedClassName.substring(0, fullyQualifiedClassName.lastIndexOf(".")));
ClassMetadata cmd = pmd.newClassMetadata(fullyQualifiedClassName.substring(fullyQualifiedClassName.lastIndexOf(".") + 1));
cmd.setTable(new ClassName(fullyQualifiedClassName).getSimpleName().toLowerCase()).setDetachable(true);
cmd.setPersistenceModifier(ClassPersistenceModifier.PERSISTENCE_CAPABLE);
cmd.setIdentityType(IdentityType.APPLICATION);
cmd.newDatastoreIdentityMetadata().setStrategy(IdGeneratorStrategy.INCREMENT);
cmd.newInheritanceMetadata().setStrategy(InheritanceStrategy.NEW_TABLE);
FieldMetadata fmd = cmd.newFieldMetadata(fieldName);
fmd.setNullValue(NullValue.DEFAULT).setColumn(fieldName);
return md;
}
示例14: getNumeroRegistro
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT, sequence = "secuenciaRegistro")
@MemberOrder(sequence = "1")
@Column(allowsNull = "false")
public int getNumeroRegistro() {
return numeroRegistro;
}
示例15: getId
import javax.jdo.annotations.IdGeneratorStrategy; //导入依赖的package包/类
@PrimaryKey
@Persistent(valueStrategy=IdGeneratorStrategy.INCREMENT)
public Long getId() {
return id;
}
开发者ID:GoogleCloudPlatform,项目名称:appengine-cloudsql-native-mysql-datanucleus-jdo-demo-java,代码行数:6,代码来源:Greeting.java