本文整理汇总了Java中org.netbeans.jpa.modeler.spec.SecondaryTable类的典型用法代码示例。如果您正苦于以下问题:Java SecondaryTable类的具体用法?Java SecondaryTable怎么用?Java SecondaryTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecondaryTable类属于org.netbeans.jpa.modeler.spec包,在下文中一共展示了SecondaryTable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildDBTable
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
/**
* INTERNAL: Return the create table object.
*/
public void buildDBTable(AbstractSession session, DBMapping dbMapping) throws ValidationException {
DBTable dBTable;
Entity entity = (Entity) intrinsicEntity.get(0);
Table table;
if (attribute instanceof RelationAttribute) {
dBTable = new DBRelationTable(getFullName(), entity, (RelationAttribute) attribute);//Todo pass managedClass
} else if (attribute instanceof ElementCollection) {
dBTable = new DBCollectionTable(getFullName(), entity, (ElementCollection) attribute);
} else if((table = entity.getTable(getFullName())) instanceof SecondaryTable){
dBTable = new DBSecondaryTable(getFullName(), entity, (SecondaryTable)table);
} else {
dBTable = new DBBaseTable(getFullName(), entity);
}
dBTable.setId(NBModelerUtil.getAutoGeneratedStringId());
for (Iterator<FieldDefinition> itetrator = getFields().iterator(); itetrator.hasNext();) {
JPAMFieldDefinition field = (JPAMFieldDefinition) itetrator.next();
field.buildDBColumn(dBTable, session, this);
}
dbMapping.addTable(dBTable);
}
开发者ID:jeddict,项目名称:jeddict,代码行数:28,代码来源:JPAMTableDefinition.java
示例2: getPopupMenuItemList
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
@Override
protected List<JMenuItem> getPopupMenuItemList() {
List<JMenuItem> menuList = super.getPopupMenuItemList();
JMenuItem menuItem = new JMenuItem("Create Secondary Table");
menuItem.addActionListener((ActionEvent e) -> {
Entity entity = this.getBaseElementSpec().getEntity();
String secondaryTableName = JOptionPane.showInputDialog((Component) BaseTableWidget.this.getModelerScene().getModelerPanelTopComponent(), "Please enter secondary table name");
if (entity.getTable(secondaryTableName) == null) { //check from complete table list
SecondaryTable secondaryTable = new SecondaryTable();
secondaryTable.setName(secondaryTableName);
entity.addSecondaryTable(secondaryTable);
ModelerFile parentFile = BaseTableWidget.this.getModelerScene().getModelerFile().getParentFile();
DBUtil.openDBViewer(parentFile);
JeddictLogger.recordDBAction("Create Secondary Table");
} else {
JOptionPane.showMessageDialog((Component) BaseTableWidget.this.getModelerScene().getModelerPanelTopComponent(), "Table already exist");
}
});
menuList.add(0, menuItem);
return menuList;
}
开发者ID:jeddict,项目名称:jeddict,代码行数:22,代码来源:BaseTableWidget.java
示例3: processSecondaryTable
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
protected void processSecondaryTable(
List<SecondaryTable> parsedSecondaryTables) {
if (parsedSecondaryTables == null || parsedSecondaryTables.isEmpty()) {
return;
}
classDef.setSecondaryTables(new SecondaryTablesSnippet(repeatable));
for (SecondaryTable parsedSecondaryTable : parsedSecondaryTables) {
List<PrimaryKeyJoinColumnSnippet> primaryKeyJoinColumns
= getPrimaryKeyJoinColumns(parsedSecondaryTable.getPrimaryKeyJoinColumn());
List<UniqueConstraintSnippet> uniqueConstraints = getUniqueConstraints(
parsedSecondaryTable.getUniqueConstraint());
SecondaryTableSnippet secondaryTable = new SecondaryTableSnippet();
secondaryTable.setCatalog(parsedSecondaryTable.getCatalog());
secondaryTable.setName(parsedSecondaryTable.getName());
secondaryTable.setSchema(parsedSecondaryTable.getSchema());
secondaryTable.setUniqueConstraints(uniqueConstraints);
secondaryTable.setIndices(getIndexes(parsedSecondaryTable.getIndex()));
secondaryTable.setPrimaryKeyJoinColumns(primaryKeyJoinColumns);
secondaryTable.setForeignKey(getForeignKey(parsedSecondaryTable.getForeignKey()));
classDef.getSecondaryTables().add(secondaryTable);
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:29,代码来源:ClassGenerator.java
示例4: processSecondaryTable
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
protected void processSecondaryTable(
List<SecondaryTable> parsedSecondaryTables) {
if (parsedSecondaryTables == null || parsedSecondaryTables.isEmpty()) {
return;
}
classDef.setSecondaryTables(new SecondaryTablesSnippet());
for (SecondaryTable parsedSecondaryTable : parsedSecondaryTables) {
List<PrimaryKeyJoinColumnSnippet> primaryKeyJoinColumns
= getPrimaryKeyJoinColumns(parsedSecondaryTable.getPrimaryKeyJoinColumn());
List<UniqueConstraintSnippet> uniqueConstraints = getUniqueConstraints(
parsedSecondaryTable.getUniqueConstraint());
SecondaryTableSnippet secondaryTable = new SecondaryTableSnippet();
secondaryTable.setCatalog(parsedSecondaryTable.getCatalog());
secondaryTable.setName(parsedSecondaryTable.getName());
secondaryTable.setSchema(parsedSecondaryTable.getSchema());
secondaryTable.setUniqueConstraints(uniqueConstraints);
secondaryTable.setPrimaryKeyJoinColumns(primaryKeyJoinColumns);
classDef.getSecondaryTables().addSecondaryTable(secondaryTable);
}
}
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:28,代码来源:ClassGenerator.java
示例5: getInstance
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的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
示例6: JPAMFieldDefinition
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
public JPAMFieldDefinition(Entity intrinsicClass, boolean primaryKeyJoinColumn, SecondaryTable secondaryTable) {
this(intrinsicClass, primaryKeyJoinColumn);
this.secondaryTable = secondaryTable;
}
开发者ID:jeddict,项目名称:jeddict,代码行数:5,代码来源:JPAMFieldDefinition.java
示例7: findPrimaryKeyJoinColumns
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
public static List<PrimaryKeyJoinColumn> findPrimaryKeyJoinColumns(SecondaryTable secondaryTable) {
return secondaryTable.getPrimaryKeyJoinColumn();
}
开发者ID:jeddict,项目名称:jeddict,代码行数:4,代码来源:JoinColumnFinder.java
示例8: DBSecondaryTable
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
public DBSecondaryTable(String name, Entity entity, SecondaryTable secondaryTable) {
super(name, entity);
this.secondaryTable = secondaryTable;
}
开发者ID:jeddict,项目名称:jeddict,代码行数:5,代码来源:DBSecondaryTable.java
示例9: getSecondaryTable
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
/**
* @return the secondaryTable
*/
public SecondaryTable getSecondaryTable() {
return secondaryTable;
}
开发者ID:jeddict,项目名称:jeddict,代码行数:7,代码来源:DBSecondaryTable.java
示例10: DBPrimaryKeyJoinColumn
import org.netbeans.jpa.modeler.spec.SecondaryTable; //导入依赖的package包/类
public DBPrimaryKeyJoinColumn(String name, SecondaryTable secondaryTable, Id attribute) {
super(name, attribute);
joinColumns = JoinColumnFinder.findPrimaryKeyJoinColumns(secondaryTable);
joinColumn = JoinColumnFinder.findPrimaryKeyJoinColumn(name, joinColumns);
}
开发者ID:jeddict,项目名称:jeddict,代码行数:6,代码来源:DBPrimaryKeyJoinColumn.java
注:本文中的org.netbeans.jpa.modeler.spec.SecondaryTable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论