SAIL-232: AppliedPatch.hbm.xml

- Basic CREATE script for core tables: AlfrescoCreate-3.3-RepoTables.sql
 - Removed Hibernate control of alf_applied_patch


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18101 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-01-18 16:39:18 +00:00
parent 7f24c8c4e7
commit b96d174e1f
26 changed files with 941 additions and 696 deletions

View File

@@ -0,0 +1,114 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.domain.patch.ibatis;
import java.util.List;
import org.alfresco.repo.domain.patch.AbstractAppliedPatchDAOImpl;
import org.alfresco.repo.domain.patch.AppliedPatchEntity;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
/**
* iBatis-specific implementation of the AppliedPatch DAO.
*
* @author Derek Hulley
* @since 3.3
*/
public class AppliedPatchDAOImpl extends AbstractAppliedPatchDAOImpl
{
private static final String INSERT_APPLIED_PATCH = "alfresco.appliedpatch.insert_AppliedPatch";
private static final String UPDATE_APPLIED_PATCH = "alfresco.appliedpatch.update_AppliedPatch";
private static final String SELECT_APPLIED_PATCH_BY_ID = "alfresco.appliedpatch.select_AppliedPatchById";
private static final String SELECT_ALL_APPLIED_PATCH = "alfresco.appliedpatch.select_AllAppliedPatches";
private SqlMapClientTemplate template;
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
{
this.template = sqlMapClientTemplate;
}
@Override
protected void createAppliedPatchEntity(AppliedPatchEntity entity)
{
template.insert(INSERT_APPLIED_PATCH, entity);
}
public void updateAppliedPatchEntity(AppliedPatchEntity appliedPatch)
{
template.update(UPDATE_APPLIED_PATCH, appliedPatch);
}
@Override
protected AppliedPatchEntity getAppliedPatchEntity(String id)
{
AppliedPatchEntity entity = new AppliedPatchEntity();
entity.setId(id);
entity = (AppliedPatchEntity) template.queryForObject(SELECT_APPLIED_PATCH_BY_ID, entity);
// Could be null
return entity;
}
@SuppressWarnings("unchecked")
@Override
protected List<AppliedPatchEntity> getAppliedPatchEntities()
{
return (List<AppliedPatchEntity>) template.queryForList(SELECT_ALL_APPLIED_PATCH);
}
//
// @Override
// protected EncodingEntity getEncodingEntity(Long id)
// {
// EncodingEntity encodingEntity = new EncodingEntity();
// encodingEntity.setId(id);
// encodingEntity = (EncodingEntity) template.queryForObject(SELECT_ENCODING_BY_ID, encodingEntity);
// // Done
// return encodingEntity;
// }
//
// @Override
// protected EncodingEntity getEncodingEntity(String encoding)
// {
// EncodingEntity encodingEntity = new EncodingEntity();
// encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
// encodingEntity = (EncodingEntity) template.queryForObject(SELECT_ENCODING_BY_KEY, encodingEntity);
// // Could be null
// return encodingEntity;
// }
//
// @Override
// protected EncodingEntity createEncodingEntity(String encoding)
// {
// EncodingEntity encodingEntity = new EncodingEntity();
// encodingEntity.setVersion(MimetypeEntity.CONST_LONG_ZERO);
// encodingEntity.setEncoding(encoding == null ? null : encoding.toLowerCase());
// Long id = (Long) template.insert(INSERT_ENCODING, encodingEntity);
// encodingEntity.setId(id);
// // Done
// return encodingEntity;
// }
}

View File

@@ -43,37 +43,37 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
private static final String SELECT_AVM_LD_NODE_ENTITIES_NULL_VERSION = "alfresco.avm.select_AVMNodes_nullVersionLayeredDirectories";
private static final String SELECT_AVM_LF_NODE_ENTITIES_NULL_VERSION = "alfresco.avm.select_AVMNodes_nullVersionLayeredFiles";
private SqlMapClientTemplate avmTemplate;
private SqlMapClientTemplate template;
public void setAvmSqlMapClientTemplate(SqlMapClientTemplate avmSqlMapClientTemplate)
public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate)
{
this.avmTemplate = avmSqlMapClientTemplate;
this.template = sqlMapClientTemplate;
}
@Override
protected Long getAVMNodeEntitiesCountWhereNewInStore()
{
return (Long) avmTemplate.queryForObject(SELECT_AVM_NODE_ENTITIES_COUNT_WHERE_NEW_IN_STORE);
return (Long) template.queryForObject(SELECT_AVM_NODE_ENTITIES_COUNT_WHERE_NEW_IN_STORE);
}
@SuppressWarnings("unchecked")
@Override
protected List<AVMNodeEntity> getAVMNodeEntitiesWithEmptyGUID()
{
return (List<AVMNodeEntity>) avmTemplate.queryForList(SELECT_AVM_NODE_ENTITIES_WITH_EMPTY_GUID);
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODE_ENTITIES_WITH_EMPTY_GUID);
}
@SuppressWarnings("unchecked")
@Override
protected List<AVMNodeEntity> getNullVersionLayeredDirectoryNodeEntities()
{
return (List<AVMNodeEntity>) avmTemplate.queryForList(SELECT_AVM_LD_NODE_ENTITIES_NULL_VERSION);
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_LD_NODE_ENTITIES_NULL_VERSION);
}
@SuppressWarnings("unchecked")
@Override
protected List<AVMNodeEntity> getNullVersionLayeredFileNodeEntities()
{
return (List<AVMNodeEntity>) avmTemplate.queryForList(SELECT_AVM_LF_NODE_ENTITIES_NULL_VERSION);
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_LF_NODE_ENTITIES_NULL_VERSION);
}
}