当前位置: 首页>>代码示例>>Java>>正文


Java IdGeneratorStrategy类代码示例

本文整理汇总了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);
}
 
开发者ID:motech,项目名称:motech,代码行数:17,代码来源:EntityMetadataBuilderTest.java

示例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;
}
 
开发者ID:motech,项目名称:motech,代码行数:13,代码来源:EntityMetadataBuilderImpl.java

示例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");
}
 
开发者ID:motech,项目名称:motech,代码行数:9,代码来源:EntityMetadataBuilderTest.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:17,代码来源:Factura.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:12,代码来源:Empleado.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:14,代码来源:Cliente.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:15,代码来源:Menu.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:14,代码来源:Comanda.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:15,代码来源:Reserva.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:15,代码来源:Oferta.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:15,代码来源:Producto.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:15,代码来源:Pedido.java

示例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;
}
 
开发者ID:subhrajitroy,项目名称:osgi-jdo-sample,代码行数:15,代码来源:EntityMetadataFactory.java

示例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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:7,代码来源:Log.java

示例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


注:本文中的javax.jdo.annotations.IdGeneratorStrategy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。