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


Java PrimaryKeyJoinColumn类代码示例

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


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

示例1: isEmpty

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
public static boolean isEmpty(PrimaryKeyJoinColumn column) {
    boolean empty = false;
    if (StringUtils.isBlank(column.getName()) && StringUtils.isBlank(column.getReferencedColumnName())
            && StringUtils.isBlank(column.getColumnDefinition())
            && ForeignKeyValidator.isEmpty(column.getForeignKey())) {
        empty = true;
    }
    if(!empty && StringUtils.isBlank(column.getName()) &&  StringUtils.isNotBlank(column.getImplicitName())){
        column.setName(column.getImplicitName());
        column.setImplicitName(null);
    }
    if(!empty && StringUtils.isBlank(column.getName())){
        empty = true;
    }
    return empty;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:17,代码来源:PrimaryKeyJoinColumnValidator.java

示例2: getPrimaryKeyJoinColumns

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
protected List<PrimaryKeyJoinColumnSnippet> getPrimaryKeyJoinColumns(
        List<PrimaryKeyJoinColumn> parsedPrimaryKeyJoinColumns) {

    if (parsedPrimaryKeyJoinColumns == null || parsedPrimaryKeyJoinColumns.isEmpty()) {
        return Collections.EMPTY_LIST;
    }

    List<PrimaryKeyJoinColumnSnippet> primaryKeyJoinColumns = new ArrayList<>();

    for (PrimaryKeyJoinColumn parsedPrimaryKeyJoinColumn : parsedPrimaryKeyJoinColumns) {
        PrimaryKeyJoinColumnSnippet primaryKeyJoinColumn = new PrimaryKeyJoinColumnSnippet();
        primaryKeyJoinColumn.setColumnDefinition(parsedPrimaryKeyJoinColumn.getColumnDefinition());
        primaryKeyJoinColumn.setName(parsedPrimaryKeyJoinColumn.getName());
        primaryKeyJoinColumn.setReferencedColumnName(parsedPrimaryKeyJoinColumn.getReferencedColumnName());
        primaryKeyJoinColumn.setForeignKey(getForeignKey(parsedPrimaryKeyJoinColumn.getForeignKey()));
        primaryKeyJoinColumns.add(primaryKeyJoinColumn);
    }

    return primaryKeyJoinColumns;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:21,代码来源:ClassGenerator.java

示例3: getPrimaryKeyJoinColumnsProperty

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
public static PropertySupport getPrimaryKeyJoinColumnsProperty(String id, String name, String desc, EntityWidget entityWidget, Entity entity) {
    JPAModelerScene modelerScene = entityWidget.getModelerScene();
    final List<? extends PrimaryKeyJoinColumn> primaryKeyJoinColumnsSpec = entity.getPrimaryKeyJoinColumn();
    final NAttributeEntity attributeEntity = new NAttributeEntity(id, name, desc);
    attributeEntity.setCountDisplay(new String[]{"No PrimaryKeyJoinColumns exist", "One PrimaryKeyJoinColumn exist", "PrimaryKeyJoinColumns exist"});

    List<Column> columns = new ArrayList<>();
    columns.add(new Column("Column Name", false, String.class));
    columns.add(new Column("Referenced Column Name", false, String.class));
    attributeEntity.setColumns(columns);
    attributeEntity.setCustomDialog(new PrimaryKeyJoinColumnPanel(entity));
    attributeEntity.setTableDataListener(new NEntityDataListener<>(primaryKeyJoinColumnsSpec,
            t -> Arrays.asList(t.getName(), t.getReferencedColumnName())));
    entityWidget.addPropertyVisibilityHandler("PrimaryKeyJoinColumns", () -> {
        InheritanceStateType inheritanceState = entityWidget.getInheritanceState();
        return inheritanceState == InheritanceStateType.BRANCH || inheritanceState == InheritanceStateType.LEAF;
    });
    return new NEntityPropertySupport(modelerScene.getModelerFile(), attributeEntity);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:20,代码来源:PropertiesHandler.java

示例4: getPrimaryKeyJoinColumns

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
protected List<PrimaryKeyJoinColumnSnippet> getPrimaryKeyJoinColumns(
        List<PrimaryKeyJoinColumn> parsedPrimaryKeyJoinColumns) {

    if (parsedPrimaryKeyJoinColumns == null || parsedPrimaryKeyJoinColumns.isEmpty()) {
        return Collections.EMPTY_LIST;
    }

    List<PrimaryKeyJoinColumnSnippet> primaryKeyJoinColumns
            = new ArrayList<PrimaryKeyJoinColumnSnippet>();

    for (PrimaryKeyJoinColumn parsedPrimaryKeyJoinColumn : parsedPrimaryKeyJoinColumns) {

        PrimaryKeyJoinColumnSnippet primaryKeyJoinColumn = new PrimaryKeyJoinColumnSnippet();

        primaryKeyJoinColumn.setColumnDefinition(
                parsedPrimaryKeyJoinColumn.getColumnDefinition());
        primaryKeyJoinColumn.setName(parsedPrimaryKeyJoinColumn.getName());
        primaryKeyJoinColumn.setReferencedColumnName(
                parsedPrimaryKeyJoinColumn.getReferencedColumnName());

        primaryKeyJoinColumns.add(primaryKeyJoinColumn);
    }

    return primaryKeyJoinColumns;
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:26,代码来源:ClassGenerator.java

示例5: processPrimaryKeyJoinColumns

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
protected void processPrimaryKeyJoinColumns(
        List<PrimaryKeyJoinColumn> parsedPrimaryKeyJoinColumns) {

    if (parsedPrimaryKeyJoinColumns == null
            || parsedPrimaryKeyJoinColumns.isEmpty()) {
        return;
    }

    classDef.setPrimaryKeyJoinColumns(new PrimaryKeyJoinColumnsSnippet());

    for (PrimaryKeyJoinColumn parsedPrimaryKeyJoinColumn : parsedPrimaryKeyJoinColumns) {
        PrimaryKeyJoinColumnSnippet primaryKeyJoinColumn = new PrimaryKeyJoinColumnSnippet();

        primaryKeyJoinColumn.setColumnDefinition(
                parsedPrimaryKeyJoinColumn.getColumnDefinition());
        primaryKeyJoinColumn.setName(parsedPrimaryKeyJoinColumn.getName());
        primaryKeyJoinColumn.setReferencedColumnName(
                parsedPrimaryKeyJoinColumn.getReferencedColumnName());

        classDef.getPrimaryKeyJoinColumns().addPrimaryKeyJoinColumn(
                primaryKeyJoinColumn);
    }
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:24,代码来源:ClassGenerator.java

示例6: marshal

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
public PrimaryKeyJoinColumn marshal(PrimaryKeyJoinColumn column) throws Exception {
    if (column != null && isEmpty(column)) {
        return null;
    }
    return column;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:8,代码来源:PrimaryKeyJoinColumnValidator.java

示例7: destroy

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
public void destroy() {
    try {
        if (this.getModelerFile().isLoaded() && this.getBaseElementSpec() != null) {
            this.getBaseElementSpec().getTables().stream().map(t -> t.getEntity()).forEach(e -> {
                AttributeValidator.filter(e);
                AssociationValidator.filter(e);
            });
            this.getBaseElementSpec().getTables().stream().flatMap(t -> t.getColumns().stream())
                    .filter(c -> c instanceof DBForeignKey).collect(toList())
                    .forEach((DBColumn column) -> {
                        List<IJoinColumn> joinColumns;
                        IJoinColumn joinColumn;
                        joinColumn = ((DBForeignKey) column).getJoinColumn();
                        joinColumns = ((DBForeignKey) column).getJoinColumns();
                        if (joinColumn != null) {
                            if (joinColumn instanceof JoinColumn && JoinColumnValidator.isEmpty((JoinColumn) joinColumn)) {
                                joinColumns.remove(joinColumn);
                            } else if (joinColumn instanceof PrimaryKeyJoinColumn && PrimaryKeyJoinColumnValidator.isEmpty((PrimaryKeyJoinColumn) joinColumn)) {
                                joinColumns.remove(joinColumn);
                            }
                        }
                    });
        }
    } catch (Exception ex) {
        this.getModelerFile().handleException(ex);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:29,代码来源:DBModelerScene.java

示例8: updateEntity

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
public void updateEntity(Entity<PrimaryKeyJoinColumn> entityValue) {
    this.setTitle("Update PrimaryKeyJoinColumn");
    if (entityValue.getClass() == RowValue.class) {
        this.setEntity(entityValue);
        Object[] row = ((RowValue) entityValue).getRow();
        PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) row[0];
        name_TextField.setText(joinColumn.getName());
        referencedColumnName_TextField.setText(joinColumn.getReferencedColumnName());
        columnDefinition_TextArea.setText(joinColumn.getColumnDefinition());
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:PrimaryKeyJoinColumnPanel.java

示例9: isNotEmpty

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
public static boolean isNotEmpty(PrimaryKeyJoinColumn column) {
    return !isEmpty(column);
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:4,代码来源:PrimaryKeyJoinColumnValidator.java

示例10: getInstance

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
public static EntitySpecAccessor getInstance(WorkSpace workSpace, Entity entity) {
    EntitySpecAccessor accessor = new EntitySpecAccessor(entity);
    accessor.setName(entity.getName());
    accessor.setClassName(entity.getClazz());
    accessor.setAccess("VIRTUAL");
    if(TRUE.equals(entity.getAbstract())){//set abstract
        MetadataClass metadataClass = new MetadataClass(null, entity.getClazz());//accessor.getMetadataFactory()
        metadataClass.setModifiers(1024);
        accessor.setAccessibleObject(metadataClass);//Test : Modifier.isAbstract(accessor.getJavaClass().getModifiers());
    }
    
    accessor.setAttributes(entity.getAttributes().getAccessor(workSpace));
    if (entity.getTable() != null) {
        accessor.setTable(entity.getTable().getAccessor());
    }
    if(!entity.getSecondaryTable().isEmpty()){
        List<SecondaryTableMetadata> secondaryTableMetadata = new ArrayList<>();
        for(SecondaryTable secondaryTable : entity.getSecondaryTable()){
           secondaryTableMetadata.add(secondaryTable.getAccessor());
        }
        accessor.setSecondaryTables(secondaryTableMetadata);
    }
    processSuperClass(workSpace, entity, accessor);
    if (entity.getInheritance() != null) {
        accessor.setInheritance(entity.getInheritance().getAccessor());
    } else if(!entity.getSubclassList().isEmpty()) { //if Inheritance null and ROOT/BRANCH then set default
        accessor.setInheritance(Inheritance.getDefaultAccessor());
    }
    
    if (entity.getIdClass() != null) {
        accessor.setIdClassName(entity.getIdClass().getClazz());
    }
    
    if (entity.getDiscriminatorColumn() != null) {
        accessor.setDiscriminatorColumn(entity.getDiscriminatorColumn().getAccessor());
    }
    accessor.setDiscriminatorValue(entity.getDiscriminatorValue());

    AttributeValidator.filter(entity);
    accessor.setAttributeOverrides(entity.getAttributeOverride()
            .stream()
            .map(AttributeOverrideSpecMetadata::getInstance)
            .collect(toList()));
    AssociationValidator.filter(entity);
    accessor.setAssociationOverrides(entity.getAssociationOverride()
            .stream()
            .map(AssociationOverrideSpecMetadata::getInstance)
            .collect(toList()));

    PrimaryKeyJoinColumnValidator.filter(entity.getPrimaryKeyJoinColumn());
    accessor.setPrimaryKeyJoinColumns(entity.getPrimaryKeyJoinColumn()
            .stream()
            .map(PrimaryKeyJoinColumn::getAccessor)
            .collect(toList()));
    
    accessor.setConverts(entity.getConverts()
            .stream()
            .map(Convert::getAccessor)
            .collect(toList()));
    
    if (entity.getSequenceGenerator()!= null) {
        accessor.setSequenceGenerator(entity.getSequenceGenerator().getAccessor());
    }  
    if (entity.getTableGenerator() != null) {
        accessor.setTableGenerator(entity.getTableGenerator().getAccessor());
    }  
    
    return accessor;

}
 
开发者ID:jeddict,项目名称:jCode,代码行数:71,代码来源:EntitySpecAccessor.java

示例11: findPrimaryKeyJoinColumns

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
public static List<PrimaryKeyJoinColumn> findPrimaryKeyJoinColumns(Entity entity) {
    return entity.getPrimaryKeyJoinColumn();
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:4,代码来源:JoinColumnFinder.java

示例12: getJoinColumn

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
/**
 * @return the inverseJoinColumn
 */
@Override
public PrimaryKeyJoinColumn getJoinColumn() {
    return joinColumn;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:8,代码来源:DBPrimaryKeyJoinColumn.java

示例13: getJoinColumns

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
public List<PrimaryKeyJoinColumn> getJoinColumns() {
    return joinColumns;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:5,代码来源:DBPrimaryKeyJoinColumn.java

示例14: updateName

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
protected void updateName(String newName) {
    PrimaryKeyJoinColumn column = this.getBaseElementSpec().getJoinColumn();
    column.setName(newName);
    ColumnUtil.syncronizeCompositeKeyJoincolumn(this.getReferenceFlowWidget().get(0).getReferenceColumnWidget().getTableWidget(), this.getTableWidget());//TODO get(n) // TODO applicable here ?
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:7,代码来源:PrimaryKeyJoinColumnWidget.java

示例15: createPropertySet

import org.netbeans.jpa.modeler.spec.PrimaryKeyJoinColumn; //导入依赖的package包/类
@Override
public void createPropertySet(ElementPropertySet set) {
    PrimaryKeyJoinColumn joinColumn = this.getBaseElementSpec().getJoinColumn();
    set.createPropertySet("PK_JOIN_COLUMN", this, joinColumn, getPropertyChangeListeners());
    set.createPropertySet("FOREIGN_KEY", this, joinColumn.getForeignKey() , null);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:7,代码来源:PrimaryKeyJoinColumnWidget.java


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