use of com.epam.pipeline.entity.metadata.MetadataClass in project cloud-pipeline by epam.
the class MetadataEntityManager method loadClass.
public MetadataClass loadClass(Long id) {
MetadataClass metadataClass = metadataClassDao.loadMetadataClass(id);
Assert.notNull(metadataClass, messageHelper.getMessage(MessageConstants.ERROR_METADATA_ENTITY_CLASS_NOT_FOUND, id));
return metadataClass;
}
use of com.epam.pipeline.entity.metadata.MetadataClass in project cloud-pipeline by epam.
the class MetadataEntityManager method deleteMetadataEntitiesInProject.
/**
* Deletes all metadata entities, present in project {@link com.epam.pipeline.entity.pipeline.Folder}.
* Optionally supports deletion only of specified {@link MetadataClass}
* @param projectId specifies {@link com.epam.pipeline.entity.pipeline.Folder} to delete metadata from
* @param entityClassName optional name of {@link MetadataClass}, if it is specified only entities of
* this class are deleted
*/
@Transactional(propagation = Propagation.REQUIRED)
public void deleteMetadataEntitiesInProject(Long projectId, String entityClassName) {
Objects.requireNonNull(projectId);
if (StringUtils.hasText(entityClassName)) {
MetadataClass metadataClass = loadClass(entityClassName);
metadataEntityDao.deleteMetadataClassFromProject(projectId, metadataClass.getId());
} else {
metadataEntityDao.deleteMetadataFromFolder(projectId);
}
}
use of com.epam.pipeline.entity.metadata.MetadataClass in project cloud-pipeline by epam.
the class MetadataEntityManager method createMetadataClass.
@Transactional(propagation = Propagation.REQUIRED)
public MetadataClass createMetadataClass(final String className) {
if (StringUtils.isEmpty(className)) {
throw new IllegalArgumentException("User entity class name must be not empty.");
}
MetadataClass metadataClass = new MetadataClass();
metadataClass.setName(className);
metadataClassDao.createMetadataClass(metadataClass);
return metadataClass;
}
use of com.epam.pipeline.entity.metadata.MetadataClass in project cloud-pipeline by epam.
the class MetadataEntityManager method getMetadataKeys.
public List<MetadataField> getMetadataKeys(Long folderId, String className) {
Assert.notNull(folderId, messageHelper.getMessage(MessageConstants.ERROR_INVALID_METADATA_FILTER, "folderId", folderId));
folderManager.load(folderId);
Assert.notNull(className, messageHelper.getMessage(MessageConstants.ERROR_INVALID_METADATA_FILTER, "class", className));
MetadataClass metadataClass = loadClass(className);
return metadataEntityDao.getMetadataKeys(folderId, metadataClass.getId());
}
use of com.epam.pipeline.entity.metadata.MetadataClass in project cloud-pipeline by epam.
the class MetadataEntityManager method loadClass.
public MetadataClass loadClass(String name) {
MetadataClass metadataClass = metadataClassDao.loadMetadataClass(name);
Assert.notNull(metadataClass, messageHelper.getMessage(MessageConstants.ERROR_METADATA_ENTITY_CLASS_NOT_FOUND, name));
return metadataClass;
}
Aggregations