CPD Results

The following document contains the results of PMD's CPD 5.3.2.

Duplications

File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 243
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 496
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<Tuple<UnidirectionalLink, UserObject>> result = new ArrayList<>();
				while (resultSet.next()) {
					final UserObject owner =
							UserObject.init(resultSet.getLong(3), this.typeManager.getTypeForId(resultSet.getLong(4)));
					result.add(new Tuple<>(new UnidirectionalLink(resultSet.getLong(1), owner, target, this.typeManager
							.getUnidirectionalAssociationForId(resultSet.getLong(2))), owner));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	private Collection<Tuple<UserObject, Object>> inverseGetWithKeyHelper(final DBConnectionObjectHandler targetHandler,
			final MapAssociation association,
			final Date date) throws PersistenceException {
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 272
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 525
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<Tuple<UserObject, Object>> owners = new ArrayList<>();
				while (resultSet.next()) {
					owners.add(new Tuple<>(UserObject.init(
							resultSet.getLong(1),
							this.typeManager.getTypeForId(resultSet.getLong(2))), Object.checkForBaseTypes(
							resultSet.getLong(IntegerConstants.THREE),
							this.typeManager.getTypeForId(resultSet.getLong(IntegerConstants.FOUR)))));
				}
				return owners;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	@Override
	public Collection<Tuple<UserObject, Object>> inverseGet(final UserObject target,
			final MapAssociation association,
			final Date date) throws PersistenceException {
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 151
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 399
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<Tuple<UnidirectionalLink, Object>> result = new ArrayList<>();
				while (resultSet.next()) {
					final Object target =
							Object.checkForBaseTypes(
									resultSet.getLong(3),
									this.typeManager.getTypeForId(resultSet.getLong(4)));
					result.add(new Tuple<>(new UnidirectionalLink(resultSet.getLong(1), owner, target, this.typeManager
							.getUnidirectionalAssociationForId(resultSet.getLong(2))), target));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	private Collection<Object> getWithKeyHelper(final UserObject owner,
File Line
de/fhdw/wtf/persistence/meta/IntegerType.java 43
de/fhdw/wtf/persistence/meta/StringType.java 42
		super(id, INTEGER_NAME, false, false);
	}
	
	@Override
	public void accept(final TypeVisitor typeVisitor) {
		typeVisitor.handleBaseType(this);
		
	}
	
	@Override
	public <X> X accept(final TypeVisitorReturn<X> typeVisitor) {
		return typeVisitor.handleBaseType(this);
	}
	
	@Override
	public <Exc extends Exception> void accept(final TypeVisitorException<Exc> typeVisitor) throws Exc {
		typeVisitor.handleBaseType(this);
	}
	
	@Override
	public <X, Y extends Exception> X accept(final TypeVisitorReturnException<X, Y> typeVisitorReturnException)
			throws Y {
		return typeVisitorReturnException.handleBaseType(this);
	}
	
	@Override
	public boolean isTheSameAs(final java.lang.Object other) {
		return other instanceof IntegerType;
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 123
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 370
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<UserObject> result = new HashSet<>();
				while (resultSet.next()) {
					result.add(UserObject.init(
							resultSet.getLong(1),
							this.typeManager.getTypeForId(resultSet.getLong(2))));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	@Override
	public Collection<Tuple<UnidirectionalLink, Object>> get(final UserObject owner,
			final UnidirectionalAssociation association,
			final Date date) throws PersistenceException {
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 94
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 122
			call.setString(IntegerConstants.THREE, string);
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<UserObject> result = new HashSet<>();
				while (resultSet.next()) {
					result.add(UserObject.init(
							resultSet.getLong(1),
							this.typeManager.getTypeForId(resultSet.getLong(2))));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	@Override
	public Collection<UserObject> find(final Association association, final BigInteger integer, final Date date)
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 322
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 369
			call.setString(IntegerConstants.THREE, string);
			call.setLong(IntegerConstants.FOUR, transaction.getId());
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<UserObject> result = new HashSet<>();
				while (resultSet.next()) {
					result.add(UserObject.init(
							resultSet.getLong(1),
							this.typeManager.getTypeForId(resultSet.getLong(2))));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
File Line
de/fhdw/wtf/persistence/facade/NoDatabaseObjectFacadeImplementation.java 338
de/fhdw/wtf/persistence/facade/NoDatabaseObjectFacadeImplementation.java 364
			final StringValue val = (StringValue) ob;
			if (!val.getValue().equals(target)) {
				continue;
			}
			final Iterator<MapLink> it = this.targetMappingToMapLinks.get(val).iterator();
			while (it.hasNext()) {
				final MapLink currentMapLink = it.next();
				if (currentMapLink.getInstanceOf().equals(association)) {
					result.add(new Tuple<>(currentMapLink.getOwner(), currentMapLink.getKey()));
				}
			}
		}
		return result;
	}
	
	@Override
	public Collection<Tuple<UserObject, Object>> inverseGet(final BigInteger target,
File Line
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 95
de/fhdw/wtf/persistence/facade/OracleObjectFacadeImplementation.java 370
			call.setTimestamp(IntegerConstants.FOUR, new Timestamp(date.getTime()));
			call.execute();
			
			try (final ResultSet resultSet = ((OracleCallableStatement) call).getCursor(1)) {
				final Collection<UserObject> result = new HashSet<>();
				while (resultSet.next()) {
					result.add(UserObject.init(
							resultSet.getLong(1),
							this.typeManager.getTypeForId(resultSet.getLong(2))));
				}
				return result;
			}
		} catch (final SQLException e) {
			throw new OtherSQLException(e);
		}
	}
	
	@Override
	public Collection<UserObject> find(final Association association, final BigInteger integer, final Date date)