Created layer.isRetrievedFromDatabase() function which tests for the existence of layer.grailsLayerId