src/main/java/za/co/grindrodbank/dokuti/documenttag/DocumentTagServiceImpl.java
public void createDocumentTags(List<String> tags, DocumentEntity document) {
	    if (tags.isEmpty()) {
	        throw new InvalidRequestException("Empty tags array provided for document.", null);
	    }

	    tags.forEach(tag -> {
			DocumentTagEntity documentTag = new DocumentTagEntity();
			DocumentTagId documentTagId = new DocumentTagId();
			documentTagId.setDocumentId(document.getId());
			documentTagId.setTag(tag);
			documentTag.setId(documentTagId);
			documentTag.setDocument(document);
			this.save(documentTag);
		});
	}
/**
	 * Creates all the required tag records for a document from an array of tag
	 * strings.
	 * 
	 * @param tags     An array of tag strings to create tag records from.
	 * @param document The document to create the tags for.
	 */
Creates all the required tag records for a document from an array of tag
strings.

@param tags     An array of tag strings to create tag records from.
@param document The document to create the tags for.
Creates all the required tag records for a document from an array of tag strings . @param tags An array of tag strings to create tag records from . @param document The document to create the tags for .
public void createDocumentTags(List<String> tags, DocumentEntity document) {
	    if (tags.isEmpty()) {
	        throw new InvalidRequestException("Empty tags array provided for document.", null);
	    }
	    tags.forEach(tag -> {
			DocumentTagEntity documentTag = new DocumentTagEntity();
			DocumentTagId documentTagId = new DocumentTagId();
			documentTagId.setDocumentId(document.getId());
			documentTagId.setTag(tag);
			documentTag.setId(documentTagId);
			documentTag.setDocument(document);
			this.save(documentTag);
		});
	}
public void createDocumentTags ( List < String > tags , DocumentEntity document ) { if ( tags . isEmpty ( ) ) { throw new InvalidRequestException ( "Empty tags array provided for document." , null ) ; } tags . forEach ( tag -> { DocumentTagEntity documentTag = new DocumentTagEntity ( ) ; DocumentTagId documentTagId = new DocumentTagId ( ) ; documentTagId . setDocumentId ( document . getId ( ) ) ; documentTagId . setTag ( tag ) ; documentTag . setId ( documentTagId ) ; documentTag . setDocument ( document ) ; this . save ( documentTag ) ; } ) ; }
Creates all the required tag records for a document from an array of tag
 strings.
Creates all the required tag records for a document from an array of tag strings .