/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsPropertyDefinition(m_id, m_name, m_type); }
/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsPropertyDefinition(m_id, m_name, m_type); }
/** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinitions(org.opencms.db.CmsDbContext, CmsUUID) */ public List readPropertyDefinitions(CmsDbContext dbc, CmsUUID projectId) throws CmsDataAccessException { ArrayList propertyDefinitions = new ArrayList(); ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; try { conn = m_sqlManager.getConnection(dbc); stmt = m_sqlManager.getPreparedStatement(conn, projectId, "C_PROPERTYDEF_READALL"); res = stmt.executeQuery(); while (res.next()) { propertyDefinitions.add(new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")), CmsPropertyDefinition.CmsPropertyType.valueOf(res.getInt(m_sqlManager.readQuery("C_PROPERTYDEF_TYPE"))))); } } 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, res); } return propertyDefinitions; }
/** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinitions(org.opencms.db.CmsDbContext, CmsUUID) */ public List<CmsPropertyDefinition> readPropertyDefinitions(CmsDbContext dbc, CmsUUID projectId) throws CmsDataAccessException { ArrayList<CmsPropertyDefinition> propertyDefinitions = new ArrayList<CmsPropertyDefinition>(); ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; try { conn = m_sqlManager.getConnection(dbc); stmt = m_sqlManager.getPreparedStatement(conn, projectId, "C_PROPERTYDEF_READALL"); res = stmt.executeQuery(); while (res.next()) { propertyDefinitions.add( new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")), CmsPropertyDefinition.CmsPropertyType.valueOf( res.getInt(m_sqlManager.readQuery("C_PROPERTYDEF_TYPE"))))); } } 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, res); } return propertyDefinitions; }
/** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinitions(org.opencms.db.CmsDbContext, CmsUUID) */ public List<CmsPropertyDefinition> readPropertyDefinitions(CmsDbContext dbc, CmsUUID projectId) throws CmsDataAccessException { ArrayList<CmsPropertyDefinition> propertyDefinitions = new ArrayList<CmsPropertyDefinition>(); try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTYDEF_READALL); @SuppressWarnings("unchecked") List<I_CmsDAOPropertyDef> res = q.getResultList(); for (I_CmsDAOPropertyDef pd : res) { propertyDefinitions.add( new CmsPropertyDefinition( new CmsUUID(pd.getPropertyDefId()), pd.getPropertyDefName(), CmsPropertyDefinition.CmsPropertyType.valueOf(pd.getPropertyDefType()))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return propertyDefinitions; }
propDef = new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")),
propDef = new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")),
propDef = new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")),
propDef = new CmsPropertyDefinition( new CmsUUID(res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_ID"))), res.getString(m_sqlManager.readQuery("C_PROPERTYDEF_NAME")),
/** * @see org.opencms.db.I_CmsHistoryDriver#readPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String) */ public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, String name) throws CmsDataAccessException { CmsPropertyDefinition propDef = null; try { Query q = m_sqlManager.createQuery(dbc, C_PROPERTYDEF_READ_HISTORY); q.setParameter(1, name); try { CmsDAOHistoryPropertyDef hpd = (CmsDAOHistoryPropertyDef)q.getSingleResult(); propDef = new CmsPropertyDefinition( new CmsUUID(hpd.getPropertyDefId()), hpd.getPropertyDefName(), CmsPropertyDefinition.CmsPropertyType.valueOf(hpd.getPropertyDefType())); } catch (NoResultException e) { throw new CmsDbEntryNotFoundException( Messages.get().container(Messages.ERR_NO_PROPERTYDEF_WITH_NAME_1, name)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return propDef; }
/** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String, CmsUUID) */ public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, String name, CmsUUID projectId) throws CmsDataAccessException { CmsPropertyDefinition propDef = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTYDEF_READ); q.setParameter(1, name); try { I_CmsDAOPropertyDef pd = (I_CmsDAOPropertyDef)q.getSingleResult(); propDef = new CmsPropertyDefinition( new CmsUUID(pd.getPropertyDefId()), pd.getPropertyDefName(), CmsPropertyDefinition.CmsPropertyType.valueOf(pd.getPropertyDefType())); } catch (NoResultException e) { throw new CmsDbEntryNotFoundException( Messages.get().container(Messages.ERR_NO_PROPERTYDEF_WITH_NAME_1, name)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE_1, e), e); } return propDef; }