• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DatabaseField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.persistence.internal.helper.DatabaseField的典型用法代码示例。如果您正苦于以下问题:Java DatabaseField类的具体用法?Java DatabaseField怎么用?Java DatabaseField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DatabaseField类属于org.eclipse.persistence.internal.helper包,在下文中一共展示了DatabaseField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPrimaryKeys

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
public String[] getPrimaryKeys(ClassDescriptor cd) {
	if (!cd.hasSimplePrimaryKey()) {
		throw new RuntimeException("only simple primary key is currently supported.");
	}
	List<DatabaseField> primaryKeyFields = cd.getPrimaryKeyFields();
	String[] res = new String[primaryKeyFields.size()];
	int i = 0;
	for (DatabaseField f : primaryKeyFields) {
		try {
			Field field = cd.getJavaClass().getDeclaredField(f.getName()); // f.getTypeName() is null  :-(
			res[i++] = field.getType().getSimpleName() + " " + f.getName();
		} catch (NoSuchFieldException e) {
			throw new RuntimeException(e);
		}
	}
	return res;
}
 
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:18,代码来源:DemoPlatform.java


示例2: getManagedAttribute

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private Attribute getManagedAttribute(ClassDescriptor refDescriptor, DatabaseField dbField, LinkedList<Attribute> intrinsicAttribute) {
    if (refDescriptor != null) {
        for (DatabaseMapping refMapping : refDescriptor.getMappings()) {
            if(!refMapping.getFields()
                    .stream()
                    .filter(field -> field == dbField)
                    .findAny()
                    .isPresent()){
                continue;
            }
            
            if (refMapping.getFields().size() > 1) {
                intrinsicAttribute.add((Attribute) refMapping.getProperty(Attribute.class));
                if(refMapping.getReferenceDescriptor() == refDescriptor){ //self-relationship with composite pk
                    return (Attribute) refMapping.getProperty(Attribute.class);
                } else {
                    return getManagedAttribute(refMapping.getReferenceDescriptor(), dbField, intrinsicAttribute);
                }
            } else if (!refMapping.getFields().isEmpty() && refMapping.getFields().get(0) == dbField) {
                intrinsicAttribute.add((Attribute) refMapping.getProperty(Attribute.class));
                return (Attribute) refMapping.getProperty(Attribute.class);
            }
        }
    }
    return null;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:27,代码来源:JPAMDefaultTableGenerator.java


示例3: addFieldsForMappedKeyMapContainerPolicy

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
 * The ContainerPolicy may contain some additional fields that should be
 * added to the table
 *
 * @see MappedKeyMapContainerPolicy
 */
protected void addFieldsForMappedKeyMapContainerPolicy(ManagedClass managedClass, Attribute managedAttribute, LinkedList<Entity> intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, boolean isInherited, ContainerPolicy cp, TableDefinition table) {
    if (cp.isMappedKeyMapPolicy()) {
        List<DatabaseField> keyFields = cp.getIdentityFieldsForMapKey();
        Iterator<DatabaseField> i = keyFields.iterator();
        while (i.hasNext()) {
            DatabaseField foreignKey = i.next();
            // to fetch managed embedded attribute
            LinkedList<Attribute> intrinsicAttribute_Local = new LinkedList<>(intrinsicAttribute);
            Attribute managedAttribute_Local = managedAttribute;
            if (managedAttribute instanceof MapKeyHandler && ((MapKeyHandler) managedAttribute).getMapKeyEmbeddable() != null) {
                managedAttribute_Local = getManagedAttribute(cp.getDescriptorForMapKey(), foreignKey, intrinsicAttribute_Local);
            }
            FieldDefinition fieldDef = getFieldDefFromDBField(intrinsicEntity.get(0), intrinsicAttribute_Local, managedAttribute_Local, false, false, false, isInherited, false, false, true, foreignKey);
            if (!table.getFields().contains(fieldDef)) {
                table.addField(fieldDef);
            }
        }
        Map<DatabaseField, DatabaseField> foreignKeys = ((MappedKeyMapContainerPolicy) cp).getForeignKeyFieldsForMapKey();
        if (foreignKeys != null) {
            addForeignMappingFkConstraint(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, isInherited, foreignKeys, false);
        }
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:30,代码来源:JPAMDefaultTableGenerator.java


示例4: addForeignMappingFkConstraint

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
protected void addForeignMappingFkConstraint(ManagedClass managedClass, Attribute managedAttribute, LinkedList<Entity> intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, boolean isInherited, final Map<DatabaseField, DatabaseField> srcFields, boolean cascadeOnDelete) {
    // srcFields map from the foreign key field to the target key field

    if (srcFields.isEmpty()) {
        return;
    }

    List<DatabaseField> fkFields = new ArrayList<>();
    List<DatabaseField> targetFields = new ArrayList<>();

    for (DatabaseField fkField : srcFields.keySet()) {
        fkFields.add(fkField);
        targetFields.add(srcFields.get(fkField));
    }
    addJoinColumnsFkConstraint(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, isInherited, null, fkFields, targetFields, cascadeOnDelete);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:17,代码来源:JPAMDefaultTableGenerator.java


示例5: getFieldDefFromDBField

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
 * Build a field definition object from a database field.
 */
protected FieldDefinition getFieldDefFromDBField(Entity intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, Attribute managedAttribute, boolean inverse, boolean foriegnKey, boolean relationTable, boolean inherited, boolean dtype, boolean primaryKeyJoinColumn, boolean mapKey, DatabaseField dbField) {
    Supplier<JPAMFieldDefinition> fieldDefSupplier = () -> {
        JPAMFieldDefinition fieldDef;
        if (inherited) {
            fieldDef = new JPAMFieldDefinition(intrinsicEntity, managedAttribute, inverse, foriegnKey, relationTable);
        } else if (dtype) {
            fieldDef = new JPAMFieldDefinition(intrinsicEntity);
        } else if (primaryKeyJoinColumn) {
            fieldDef = new JPAMFieldDefinition(intrinsicEntity, primaryKeyJoinColumn);
        } else if (mapKey) {
            fieldDef = new JPAMFieldDefinition(intrinsicAttribute, managedAttribute, mapKey);
        } else {
            fieldDef = new JPAMFieldDefinition(intrinsicAttribute, managedAttribute, inverse, foriegnKey, relationTable);
        }
        return fieldDef;
    };

    return getFieldDefFromDBField(fieldDefSupplier, dbField);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:23,代码来源:JPAMDefaultTableGenerator.java


示例6: getDatabaseMapping

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private DatabaseMapping getDatabaseMapping(ClassDescriptor descriptor, DatabaseField databaseField) {
    DatabaseMapping databaseMapping = mappings.get(databaseField);
    if (databaseMapping == null) {
        for (DatabaseMapping m : descriptor.getMappings()) {
            for (DatabaseField f : m.getFields()) {
                if (mappings.get(f) == null) {
                    mappings.put(f, m);
                }
                if (databaseField == f) {
                    databaseMapping = m;
                }
            }
        }
    }
    return databaseMapping;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:17,代码来源:JPAMDefaultTableGenerator.java


示例7: buildForeignKeyConstraint

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
 * Build a foreign key constraint using
 * FieldDefinition.getForeignKeyFieldName().
 */
@Override
protected ForeignKeyConstraint buildForeignKeyConstraint(FieldDefinition field, DatabasePlatform platform) {
    Vector sourceFields = new Vector();
    Vector targetFields = new Vector();
    ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint();
    DatabaseField tempTargetField = new DatabaseField(field.getForeignKeyFieldName());
    DatabaseField tempSourceField = new DatabaseField(field.getName());

    sourceFields.add(tempSourceField.getName());
    targetFields.add(tempTargetField.getName());

    fkConstraint.setSourceFields(sourceFields);
    fkConstraint.setTargetFields(targetFields);
    fkConstraint.setTargetTable(tempTargetField.getTable().getQualifiedNameDelimited(platform));
    String tempName = buildForeignKeyConstraintName(this.getName(), tempSourceField.getName(), platform.getMaxForeignKeyNameSize(), platform);

    fkConstraint.setName(tempName);
    return fkConstraint;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:24,代码来源:JPAMTableDefinition.java


示例8: initialize

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
@Override
public void initialize( final DatabaseMapping mapping, final Session session )
{
  final DatabaseField field;
  if ( mapping instanceof DirectCollectionMapping )
  {
    field = ( (DirectCollectionMapping) mapping ).getDirectField();
  }
  else
  {
    field = mapping.getField();
  }
  field.setSqlType( java.sql.Types.OTHER );
  field.setTypeName( "geometry" );
  field.setColumnDefinition( "geometry" );
}
 
开发者ID:realityforge,项目名称:geolatte-geom-eclipselink,代码行数:17,代码来源:SqlServerConverter.java


示例9: initialize

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
@Override
public void initialize(DatabaseMapping mapping, Session session) {
    final DatabaseField field;
    if (mapping instanceof DirectCollectionMapping) {
        // handle @ElementCollection...
        field = ((DirectCollectionMapping) mapping).getDirectField();
    } else {
        field = mapping.getField();
    }

    field.setSqlType(java.sql.Types.VARCHAR);
    field.setLength(40);
    //field.setTypeName("uuid");
    //field.setColumnDefinition("UUID");
}
 
开发者ID:organicsmarthome,项目名称:OSHv4,代码行数:16,代码来源:JPAUUIDConverter.java


示例10: setDatabaseFieldParameters

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private void setDatabaseFieldParameters(Session session, DatabaseField field) {
    if (session.getPlatform() instanceof PostgreSQLPlatform) {
        field.setSqlType(Types.OTHER);
        field.setType(UUID.class);
    } else {
        field.setSqlType(Types.VARCHAR);
        field.setType(String.class);
    }
    field.setColumnDefinition("UUID");
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:EclipseLinkSessionEventListener.java


示例11: getCall

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private MappedInteraction getCall(DescriptorQueryManager queryManager, DemoOperation op) {
	MappedInteraction call = new MappedInteraction();
	call.setProperty(DemoPlatform.OPERATION, op);
	call.setProperty(KEYS, getPrimaryKeys(queryManager.getDescriptor()));
	call.setProperty(DemoPlatform.TABLE, ((EISDescriptor) queryManager.getDescriptor()).getDataTypeName());
	if (op == DemoOperation.FIND || op == DemoOperation.REMOVE) {
		for (DatabaseField field : queryManager.getDescriptor().getPrimaryKeyFields()) {
			call.addArgument(field.getName());
		}
	}
	return call;
}
 
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:13,代码来源:DemoPlatform.java


示例12: testExtensionAttribute_eclipselink_data

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
@Test
public void testExtensionAttribute_eclipselink_data() {
	ClassDescriptor classDescriptor = jpaMetadataProvider.getClassDescriptor(TestDataObject.class);
	ClassDescriptor referenceDescriptor = jpaMetadataProvider.getClassDescriptor(TestDataObjectExtension.class);
	assertNotNull("A classDescriptor should have been retrieved from JPA for TestDataObject", classDescriptor);
	assertNotNull("A classDescriptor should have been retrieved from JPA for TestDataObjectExtension",
               referenceDescriptor);
	DatabaseMapping databaseMapping = classDescriptor.getMappingForAttributeName("extension");
       assertNotNull("extension mapping missing from metamodel", databaseMapping);
       assertTrue("Should be a OneToOne mapping", databaseMapping instanceof OneToOneMapping);
       OneToOneMapping mapping = (OneToOneMapping)databaseMapping;

       assertEquals("Should be mapped by primaryKeyProperty", "primaryKeyProperty", mapping.getMappedBy());
       Map<DatabaseField, DatabaseField> databaseFields = mapping.getSourceToTargetKeyFields();
       assertEquals(1, databaseFields.size());
       for (DatabaseField sourceField : databaseFields.keySet()) {
           DatabaseField targetField = databaseFields.get(sourceField);
           assertEquals("PK_PROP", sourceField.getName());
           assertEquals("PK_PROP", targetField.getName());
       }

	assertNotNull("Reference descriptor missing from relationship", mapping.getReferenceDescriptor());
	assertEquals("Reference descriptor should be the one for TestDataObjectExtension", referenceDescriptor,
               mapping.getReferenceDescriptor());

	assertNotNull("selection query relationship missing", mapping.getSelectionQuery());
	assertNotNull("selection query missing name", mapping.getSelectionQuery().getName());
	assertEquals("selection query name incorrect", "extension", mapping.getSelectionQuery().getName());
	assertNotNull("selection query reference class", mapping.getSelectionQuery().getReferenceClass());
	assertEquals("selection query reference class incorrect", TestDataObjectExtension.class,
               mapping.getSelectionQuery().getReferenceClass());
	assertNotNull("selection query reference class name", mapping.getSelectionQuery().getReferenceClassName());
	assertNotNull("selection query source mapping missing", mapping.getSelectionQuery().getSourceMapping());
	assertEquals("selection query source mapping incorrect", mapping,
               mapping.getSelectionQuery().getSourceMapping());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:EclipseLinkAnnotationMetadataProviderImplTest.java


示例13: camelCaseToUnderscore

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private void camelCaseToUnderscore(Vector<DatabaseMapping> mappings) {
    for (DatabaseMapping mapping : mappings) {
        DatabaseField field = mapping.getField();
        if (mapping.isDirectToFieldMapping() && !mapping.isPrimaryKeyMapping()) {
            String attributeName = mapping.getAttributeName();
            String underScoredFieldName = camelCaseToUnderscore(attributeName);
            field.setName(underScoredFieldName);
        }
    }
}
 
开发者ID:antoniomaria,项目名称:karaf4-eclipselink-jpa,代码行数:11,代码来源:CamelNamingStrategy.java


示例14: customize

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void customize(Session session) throws Exception {
    Map<Class, ClassDescriptor> descriptors = session.getDescriptors();
    // iterate all descriptors
    for (ClassDescriptor classDescriptor : descriptors.values()) {
        // iterate the mappings of each descriptor
        for (DatabaseMapping databaseMapping : classDescriptor.getMappings()) {
            // process embedded properties
            if (databaseMapping.isAggregateObjectMapping()) {
                AggregateObjectMapping m = (AggregateObjectMapping) databaseMapping;
                Map<String, DatabaseField> fieldMapping = m.getAggregateToSourceFields();

                // iterate the mappings of the embeddable class
                for (DatabaseMapping refMapping : descriptors.get(m.getReferenceClass()).getMappings()) {
                    if (refMapping.isDirectToFieldMapping()) {
                        DirectToFieldMapping refDirectMapping = (DirectToFieldMapping) refMapping;
                        String refFieldName = refDirectMapping.getField().getName();
                        if (!fieldMapping.containsKey(refFieldName)) {
                            DatabaseField mappedField = refDirectMapping.getField().clone();
                            mappedField.setName(m.getAttributeName() + "_" + mappedField.getName());
                            fieldMapping.put(refFieldName, mappedField);
                        }
                    }

                }
            }

        }
    }
}
 
开发者ID:ruediste,项目名称:rise,代码行数:32,代码来源:EmbeddedFieldNamesSessionCustomizer.java


示例15: buildRelationTableDefinition

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
     * Build relation table definitions for all many-to-many relationships in a
     * EclipseLink descriptor.
     */
    protected void buildRelationTableDefinition(ManagedClass managedClass, Attribute managedAttribute, LinkedList<Entity> intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, boolean isInherited, ForeignReferenceMapping mapping, RelationTableMechanism relationTableMechanism, DatabaseField listOrderField, ContainerPolicy cp) {
        //first create relation table
        TableDefinition table = getTableDefFromDBTable(managedClass, managedAttribute, intrinsicEntity, relationTableMechanism.getRelationTable());

        //add source foreign key fields into the relation table
        List<DatabaseField> srcFkFields = relationTableMechanism.getSourceRelationKeyFields();//Relation Table
        List<DatabaseField> srcKeyFields = relationTableMechanism.getSourceKeyFields();//Entity(Owner) Table

        buildRelationTableFields(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, false, isInherited, mapping, table, srcFkFields, srcKeyFields);

        //add target foreign key fields into the relation table
        List<DatabaseField> targFkFields = relationTableMechanism.getTargetRelationKeyFields();//Relation Table
        List<DatabaseField> targKeyFields = relationTableMechanism.getTargetKeyFields();//Entity(MappedBy) Table

//        attribute.getConnectedAttribute()
        buildRelationTableFields(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, true, isInherited, mapping, table, targFkFields, targKeyFields);

        if (cp != null) {
            addFieldsForMappedKeyMapContainerPolicy(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, isInherited, cp, table);
        }

        if (listOrderField != null) {
            FieldDefinition fieldDef = getFieldDefFromDBField(listOrderField);
            if (!table.getFields().contains(fieldDef)) {
                table.addField(fieldDef);
            }
        }
    }
 
开发者ID:jeddict,项目名称:jeddict,代码行数:33,代码来源:JPAMDefaultTableGenerator.java


示例16: buildRelationTableFields

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
 * Build field definitions and foreign key constraints for all many-to-many
 * relation table.
 */
protected void buildRelationTableFields(ManagedClass managedClass, Attribute managedAttribute, LinkedList<Entity> intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, boolean inverse, boolean isInherited, ForeignReferenceMapping mapping, TableDefinition table, List<DatabaseField> fkFields, List<DatabaseField> targetFields) {
    assert fkFields.size() > 0 && fkFields.size() == targetFields.size();

    DatabaseField fkField;
    DatabaseField targetField = null;
    List<String> fkFieldNames = new ArrayList();
    List<String> targetFieldNames = new ArrayList();

    for (int index = 0; index < fkFields.size(); index++) {
        fkField = fkFields.get(index);
        targetField = targetFields.get(index);
        fkFieldNames.add(fkField.getNameDelimited(databasePlatform));
        targetFieldNames.add(targetField.getNameDelimited(databasePlatform));

        fkField = resolveDatabaseField(fkField, targetField);
        setFieldToRelationTable(intrinsicEntity.get(0), intrinsicAttribute, managedAttribute, inverse, isInherited, fkField, table);
    }

    // add a foreign key constraint from fk field to target field
    DatabaseTable targetTable = targetField.getTable();
    TableDefinition targetTblDef = getTableDefFromDBTable(managedClass, managedAttribute, intrinsicEntity, targetTable);

    if (mapping.getDescriptor().hasTablePerClassPolicy()) {
        return;
    }
    if (mapping.getReferenceDescriptor().hasTablePerClassPolicy()
            && mapping.getReferenceDescriptor().getTablePerClassPolicy().hasChild()) {
        return;
    }
    addForeignKeyConstraint(table, targetTblDef, fkFieldNames, targetFieldNames, mapping.isCascadeOnDeleteSetOnDatabase());
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:36,代码来源:JPAMDefaultTableGenerator.java


示例17: addForeignKeyFieldToSourceTargetTable

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
protected void addForeignKeyFieldToSourceTargetTable(ManagedClass managedClass, Attribute managedAttribute, LinkedList<Entity> intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, boolean isInherited, OneToOneMapping mapping) {
    if (!mapping.isForeignKeyRelationship()
            || (mapping.getReferenceDescriptor().hasTablePerClassPolicy()
            && mapping.getReferenceDescriptor().getTablePerClassPolicy().hasChild())) {
        return;
    }
    boolean cascadeDelete = false;
    // Find mappedBy target mapping to check constraint cascade.
    for (DatabaseField foreignKey : mapping.getSourceToTargetKeyFields().values()) {
        DatabaseMapping mappedBy = mapping.getReferenceDescriptor().getObjectBuilder().getMappingForField(foreignKey);
        if (mappedBy != null && mappedBy.isOneToOneMapping()) {
            cascadeDelete = ((OneToOneMapping) mappedBy).isCascadeOnDeleteSetOnDatabase();
        } else {
            List<DatabaseMapping> readOnlyMappings = mapping.getReferenceDescriptor().getObjectBuilder().getReadOnlyMappingsForField(foreignKey);
            if (readOnlyMappings != null) {
                for (DatabaseMapping mappedByPK : readOnlyMappings) {
                    if (mappedByPK.isOneToOneMapping()) {
                        cascadeDelete = ((OneToOneMapping) mappedByPK).isCascadeOnDeleteSetOnDatabase();
                        if (cascadeDelete) {
                            break;
                        }
                    }
                }
            }
        }
        if (cascadeDelete) {
            break;
        }
    }

    // If the mapping is optional and uses primary key join columns, don't
    // generate foreign key constraints which would require the target to
    // always be set.
    if (!mapping.isOptional() || !mapping.isOneToOnePrimaryKeyRelationship()) {
        addForeignMappingFkConstraint(managedClass, managedAttribute, intrinsicEntity, intrinsicAttribute, isInherited, mapping.getSourceToTargetKeyFields(), cascadeDelete);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:38,代码来源:JPAMDefaultTableGenerator.java


示例18: setFieldToRelationTable

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
/**
 * Build and add a field definition object to relation table
 */
protected void setFieldToRelationTable(Entity intrinsicEntity, LinkedList<Attribute> intrinsicAttribute, Attribute managedAttribute, boolean inverse, boolean isInherited, DatabaseField dbField, TableDefinition table) {
    FieldDefinition fieldDef = getFieldDefFromDBField(intrinsicEntity, intrinsicAttribute, managedAttribute, inverse, true, true, isInherited, false, false, false, dbField);

    if (!table.getFields().contains(fieldDef)) {
        //only add the field once, to avoid add twice if m:m is bi-directional.
        table.addField(getFieldDefFromDBField(dbField));
        fieldDef.setIsPrimaryKey(true); // make this a PK as we will be creating constrains later
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMDefaultTableGenerator.java


示例19: getJavaField

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
private Field getJavaField( final DatabaseMapping mapping, final DatabaseField field )
{
  try
  {
    final String fieldName = field.getName();
    final Class type = mapping.getDescriptor().getJavaClass();
    return type.getField( fieldName );
  }
  catch ( final NoSuchFieldException nsfe )
  {
    throw new IllegalStateException( "Unable to locate expected field", nsfe );
  }
}
 
开发者ID:realityforge,项目名称:geolatte-geom-eclipselink,代码行数:14,代码来源:PostgisConverter.java


示例20: getJDBCTypeForSetNull

import org.eclipse.persistence.internal.helper.DatabaseField; //导入依赖的package包/类
@Override
public int getJDBCTypeForSetNull(DatabaseField field) {
    return Types.NULL;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:CubaPostgreSQLPlatform.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowSet类代码示例发布时间:2022-05-22
下一篇:
Java DeterministicKeyChain类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap