protected Object create(String name, Object namingContext) { return new DbEntity(name); }
private void processStartDbEntity(Attributes atts) { String name = atts.getValue("", "name"); dbEntity = new DbEntity(name); dbEntity.setSchema(atts.getValue("", "schema")); dbEntity.setCatalog(atts.getValue("", "catalog")); dataMap.addDbEntity(dbEntity); }
private void processStartDbEntity(Attributes atts) { String name = atts.getValue("", "name"); String parentName = atts.getValue("", "parentName"); if (parentName != null) { dbEntity = new DerivedDbEntity(name); ((DerivedDbEntity) dbEntity).setParentEntityName(parentName); } else { dbEntity = new DbEntity(name); } if (!(dbEntity instanceof DerivedDbEntity)) { dbEntity.setSchema(atts.getValue("", "schema")); dbEntity.setCatalog(atts.getValue("", "catalog")); } dataMap.addDbEntity(dbEntity); }
DbEntity dbEntity = new DbEntity(); dbEntity.setName(table.getName()); dbEntity.setSchema(table.getSchema());
private void addMissingRelationship(ObjEntity entity, DbRelationship dbRelationship) { // getting DataMap from DbRelationship's source entity. This is the only object in our arguments that // is guaranteed to be a part of the map.... DataMap dataMap = dbRelationship.getSourceEntity().getDataMap(); DbEntity targetEntity = dbRelationship.getTargetEntity(); Collection<ObjEntity> mappedObjEntities = dataMap.getMappedEntities(targetEntity); if (mappedObjEntities.isEmpty()) { if (targetEntity == null) { targetEntity = new DbEntity(dbRelationship.getTargetEntityName()); } if (dbRelationship.getTargetEntityName() != null) { boolean needGeneratedEntity = createObjRelationship(entity, dbRelationship, nameGenerator.objEntityName(targetEntity)); if (needGeneratedEntity) { LOGGER.warn("Can't find ObjEntity for " + dbRelationship.getTargetEntityName()); LOGGER.warn("Db Relationship (" + dbRelationship + ") will have GUESSED Obj Relationship reflection. "); } } } else { for (Entity mappedTarget : mappedObjEntities) { createObjRelationship(entity, dbRelationship, mappedTarget.getName()); } } }
DbEntity de = new DbEntity(dbEntityName); dataMap.addDbEntity(de);
DbEntity de = new DbEntity(dbEntityName); dataMap.addDbEntity(de);
/** * Creates new DbEntity, adds it to the current DataMap, fires DbEntityEvent and DbEntityDisplayEvent. */ public void performAction(ActionEvent e) { ProjectController mediator = getProjectController(); DataMap map = mediator.getCurrentDataMap(); DbEntity entity = new DbEntity(); entity.setName(NameBuilder.builder(entity, map).name()); createEntity(map, entity); application.getUndoManager().addEdit(new CreateDbEntityUndoableEdit(map, entity)); }
/** * Drops PK sequences for all specified DbEntities. */ @Override public void dropAutoPk(DataNode node, List<DbEntity> dbEntities) throws Exception { List<String> sequences = getExistingSequences(node); // drop obsolete sequences for (DbEntity dbEntity : dbEntities) { String name; if (dbEntity.getDataMap().isQuotingSQLIdentifiers()) { DbEntity tempEnt = new DbEntity(); DataMap dm = new DataMap(); dm.setQuotingSQLIdentifiers(false); tempEnt.setDataMap(dm); tempEnt.setName(dbEntity.getName()); name = stripSchemaName(sequenceName(tempEnt)); } else { name = stripSchemaName(sequenceName(dbEntity)); } if (sequences.contains(name)) { runUpdate(node, dropSequenceString(dbEntity)); } } }