Add setting 'created' property when saving ArtifactEntry for the first time
@@ -60,6 +60,10 @@ class ArtifactEntryServiceImpl extends AbstractArtifactEntryService
//this needed to update `ArtifactEntry.path` property
entity.setArtifactCoordinates(entity.getArtifactCoordinates());
+ if(artifactEntryIsSavedForTheFirstTime(entity))
+ {
+ entity.setCreated(new Date());
+ }
ArtifactCoordinates coordinates = entity.getArtifactCoordinates();
@@ -76,6 +80,9 @@ class ArtifactEntryServiceImpl extends AbstractArtifactEntryService
return super.save(entity);
}
+ private boolean artifactEntryIsSavedForTheFirstTime(ArtifactEntry artifactEntry) {
+ return artifactEntry.getUuid() == null;
+ }
@Override
public <S extends ArtifactEntry> S save(S entity)
