use of org.alfresco.repo.domain.mimetype.MimetypeEntity in project alfresco-repository by Alfresco.
the class MimetypeDAOImpl method updateMimetypeEntity.
@Override
protected int updateMimetypeEntity(Long id, String newMimetype) {
MimetypeEntity mimetypeEntity = getMimetypeEntity(id);
if (mimetypeEntity == null) {
throw new DataIntegrityViolationException("Cannot update mimetype as ID doesn't exist: " + id);
}
mimetypeEntity.incrementVersion();
mimetypeEntity.setMimetype(newMimetype);
return template.update(UPDATE_MIMETYPE, mimetypeEntity);
}
use of org.alfresco.repo.domain.mimetype.MimetypeEntity in project alfresco-repository by Alfresco.
the class MimetypeDAOImpl method createMimetypeEntity.
@Override
protected MimetypeEntity createMimetypeEntity(String mimetype) {
MimetypeEntity mimetypeEntity = new MimetypeEntity();
mimetypeEntity.setVersion(MimetypeEntity.CONST_LONG_ZERO);
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
template.insert(INSERT_MIMETYPE, mimetypeEntity);
// Done
return mimetypeEntity;
}
use of org.alfresco.repo.domain.mimetype.MimetypeEntity in project alfresco-repository by Alfresco.
the class MimetypeDAOImpl method getMimetypeEntity.
@Override
protected MimetypeEntity getMimetypeEntity(String mimetype) {
MimetypeEntity mimetypeEntity = new MimetypeEntity();
mimetypeEntity.setMimetype(mimetype == null ? null : mimetype.toLowerCase());
mimetypeEntity = template.selectOne(SELECT_MIMETYPE_BY_KEY, mimetypeEntity);
// Could be null
return mimetypeEntity;
}
use of org.alfresco.repo.domain.mimetype.MimetypeEntity in project alfresco-repository by Alfresco.
the class MimetypeDAOImpl method getMimetypeEntity.
@Override
protected MimetypeEntity getMimetypeEntity(Long id) {
MimetypeEntity mimetypeEntity = new MimetypeEntity();
mimetypeEntity.setId(id);
mimetypeEntity = template.selectOne(SELECT_MIMETYPE_BY_ID, mimetypeEntity);
// Done
return mimetypeEntity;
}
Aggregations