leitstand-inventory-model/src/main/java/io/leitstand/inventory/model/CreateImageStubRecordFlow.java
@Override
	public void transaction(Repository repository) {
		// Merge the existing element entity to this transaction.
		Element attachedElement = repository.merge(element);
		Image image = repository.execute(findImageById(installed.getImageId()));
		
		ImageName imageName = installed.getImageName();
		if(imageName == null) {
			imageName = imageName(element.getElementRoleName()+"_"+element.getPlatformName()+"_"+installed.getImageType()+"_"+installed.getImageVersion());
		}
		
		if(image == null) {
			image = new Image(installed.getImageId(), 
							  installed.getImageType(),
							  imageName,
							  asList(attachedElement.getElementRole()),
							  attachedElement.getPlatform().getChipset(),
							  installed.getImageVersion());
			repository.add(image);
		}
		
	}
/**
	 * Checks whether an image exist and attempts to create an image stub record if the image does not exist.
	 * <p>
	 * {@inheritDoc}
	 */
Checks whether an image exist and attempts to create an image stub record if the image does not exist.
Checks whether an image exist and attempts to create an image stub record if the image does not exist .
@Override
	public void transaction(Repository repository) {
		Element attachedElement = repository.merge(element);
		Image image = repository.execute(findImageById(installed.getImageId()));
		ImageName imageName = installed.getImageName();
		if(imageName == null) {
			imageName = imageName(element.getElementRoleName()+"_"+element.getPlatformName()+"_"+installed.getImageType()+"_"+installed.getImageVersion());
		}
		if(image == null) {
			image = new Image(installed.getImageId(), 
							  installed.getImageType(),
							  imageName,
							  asList(attachedElement.getElementRole()),
							  attachedElement.getPlatform().getChipset(),
							  installed.getImageVersion());
			repository.add(image);
		}
	}
@ Override public void transaction ( Repository repository ) { Element attachedElement = repository . merge ( element ) ; Image image = repository . execute ( findImageById ( installed . getImageId ( ) ) ) ; ImageName imageName = installed . getImageName ( ) ; if ( imageName == null ) { imageName = imageName ( element . getElementRoleName ( ) + "_" + element . getPlatformName ( ) + "_" + installed . getImageType ( ) + "_" + installed . getImageVersion ( ) ) ; } if ( image == null ) { image = new Image ( installed . getImageId ( ) , installed . getImageType ( ) , imageName , asList ( attachedElement . getElementRole ( ) ) , attachedElement . getPlatform ( ) . getChipset ( ) , installed . getImageVersion ( ) ) ; repository . add ( image ) ; } }
Checks whether an image exist and attempts to create an image stub record if the image does not exist.
Checks whether an image exist and attempts to create an image stub record if the image does not exist .
// Merge the existing element entity to this transaction.