use of org.alfresco.repo.domain.propval.PropertyUniqueContextEntity in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method getPropertyUniqueContextByValues.
@Override
protected PropertyUniqueContextEntity getPropertyUniqueContextByValues(Long valueId1, Long valueId2, Long valueId3) {
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
entity.setValue1PropId(valueId1);
entity.setValue2PropId(valueId2);
entity.setValue3PropId(valueId3);
entity = template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity);
return entity;
}
use of org.alfresco.repo.domain.propval.PropertyUniqueContextEntity in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method deletePropertyUniqueContext.
public void deletePropertyUniqueContext(Long id) {
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
entity.setId(id);
template.delete(DELETE_PROPERTY_UNIQUE_CTX_BY_ID, entity);
}
use of org.alfresco.repo.domain.propval.PropertyUniqueContextEntity in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method getPropertyUniqueContextById.
@Override
protected PropertyUniqueContextEntity getPropertyUniqueContextById(Long id) {
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
entity.setId(id);
entity = template.selectOne(SELECT_PROPERTY_UNIQUE_CTX_BY_ID, entity);
return entity;
}
use of org.alfresco.repo.domain.propval.PropertyUniqueContextEntity in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method getPropertyUniqueContextByValues.
@Override
protected void getPropertyUniqueContextByValues(final PropertyUniqueContextCallback callback, Long... valueIds) {
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
for (int i = 0; i < valueIds.length; i++) {
switch(i) {
case 0:
entity.setValue1PropId(valueIds[i]);
break;
case 1:
entity.setValue2PropId(valueIds[i]);
break;
case 2:
entity.setValue3PropId(valueIds[i]);
break;
default:
throw new IllegalArgumentException("Only 3 ids allowed");
}
}
ResultHandler valueResultHandler = new ResultHandler() {
public void handleResult(ResultContext context) {
PropertyUniqueContextEntity result = (PropertyUniqueContextEntity) context.getResultObject();
Long id = result.getId();
Long propId = result.getPropertyId();
Serializable[] keys = new Serializable[3];
keys[0] = result.getValue1PropId();
keys[1] = result.getValue2PropId();
keys[2] = result.getValue3PropId();
callback.handle(id, propId, keys);
}
};
template.select(SELECT_PROPERTY_UNIQUE_CTX_BY_VALUES, entity, valueResultHandler);
// Done
}
use of org.alfresco.repo.domain.propval.PropertyUniqueContextEntity in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method createPropertyUniqueContext.
@Override
protected PropertyUniqueContextEntity createPropertyUniqueContext(Long valueId1, Long valueId2, Long valueId3, Long propertyId) {
PropertyUniqueContextEntity entity = new PropertyUniqueContextEntity();
entity.setValue1PropId(valueId1);
entity.setValue2PropId(valueId2);
entity.setValue3PropId(valueId3);
entity.setPropertyId(propertyId);
template.insert(INSERT_PROPERTY_UNIQUE_CTX, entity);
return entity;
}
Aggregations