/** * Checks if this is an internal relation type.<p> * * @return <code>true</code> if this is an internal relation type */ public boolean isInternal() { return (getId() < USER_DEFINED_MODE_LIMIT); }
/** * Checks if this is an internal relation type.<p> * * @return <code>true</code> if this is an internal relation type */ public boolean isInternal() { return (getId() < USER_DEFINED_MODE_LIMIT); }
switch (getId()) { case 3: // xml strong result = VALUE_STRONG;
switch (getId()) { case 3: // xml strong result = VALUE_STRONG;
/** * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ public int compare(CmsRelation r1, CmsRelation r2) { if (r1 == r2) { return 0; } String p1 = r1.getSourcePath() + r1.getTargetPath() + r1.getType().getId(); String p2 = r2.getSourcePath() + r2.getTargetPath() + r2.getType().getId(); return p1.compareTo(p2); } };
/** * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ public int compare(Object o1, Object o2) { if ((o1 == o2) || !(o1 instanceof CmsRelation) || !(o2 instanceof CmsRelation)) { return 0; } CmsRelation r1 = (CmsRelation)o1; String p1 = r1.getSourcePath() + r1.getTargetPath() + r1.getType().getId(); CmsRelation r2 = (CmsRelation)o2; String p2 = r2.getSourcePath() + r2.getTargetPath() + r2.getType().getId(); return p1.compareTo(p2); } };
q.setParameter(1, Integer.valueOf(CmsRelationType.OU_RESOURCE.getId())); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = internalResourceOus(q.getResultList(), resName);
conn, m_sqlManager.readQuery(projectId, "C_READ_RESOURCE_OUS")); stmt.setInt(1, CmsRelationType.OU_RESOURCE.getId()); stmt.setString(2, resName); res = stmt.executeQuery();
CmsRelationType type = it.next(); conditions.append("?"); params.add(new Integer(type.getId())); if (it.hasNext()) { conditions.append(", ");
CmsRelationType type = it.next(); conditions.append("?"); params.add(Integer.valueOf(type.getId())); if (it.hasNext()) { conditions.append(", ");
/** * @see org.opencms.db.I_CmsVfsDriver#createRelation(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.relations.CmsRelation) */ public void createRelation(CmsDbContext dbc, CmsUUID projectId, CmsRelation relation) throws CmsDataAccessException { Connection conn = null; PreparedStatement stmt = null; try { conn = m_sqlManager.getConnection(dbc); stmt = m_sqlManager.getPreparedStatement(conn, projectId, "C_CREATE_RELATION"); stmt.setString(1, relation.getSourceId().toString()); stmt.setString(2, relation.getSourcePath()); stmt.setString(3, relation.getTargetId().toString()); stmt.setString(4, relation.getTargetPath()); stmt.setInt(5, relation.getType().getId()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key( Messages.LOG_CREATE_RELATION_2, String.valueOf(projectId), relation)); } stmt.executeUpdate(); } catch (SQLException e) { throw new CmsDbSqlException(Messages.get().container( Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)), e); } finally { m_sqlManager.closeAll(dbc, conn, stmt, null); } }
CmsRelationType type = (CmsRelationType)it.next(); conditions.append("?"); params.add(new Integer(type.getId())); if (it.hasNext()) { conditions.append(", ");
projectId, "C_READ_RESOURCE_OUS")); stmt.setInt(1, CmsRelationType.OU_RESOURCE.getId()); stmt.setString(2, resName); res = stmt.executeQuery();
/** * @see org.opencms.db.I_CmsVfsDriver#createRelation(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.relations.CmsRelation) */ public void createRelation(CmsDbContext dbc, CmsUUID projectId, CmsRelation relation) throws CmsDataAccessException { try { I_CmsDAOResourceRelations rr = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); rr.setRelationSourceId(relation.getSourceId().toString()); rr.setRelationSourcePath(relation.getSourcePath()); rr.setRelationTargetId(relation.getTargetId().toString()); rr.setRelationTargetPath(relation.getTargetPath()); rr.setRelationType(relation.getType().getId()); m_sqlManager.persist(dbc, rr); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_CREATE_RELATION_2, String.valueOf(projectId), relation)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } }