include "Simantics/DB" import "http://www.simantics.org/Layer0-1.1" as L0 @deprecated toResource :: Resource -> Resource toResource = id @deprecated fromResource :: Resource -> Resource fromResource = id labelOf :: Resource -> String labelOf entity = relatedValue2 entity L0.HasLabel """Renames an entity.""" rename :: Resource -> String -> () rename entity newName = do oldName = (nameOf entity) claimRelatedValue entity L0.HasName newName addCommentMetadata ("Renamed " + oldName + " to " + newName) importJava "org.simantics.db.layer0.util.RemoverUtil" where """Removes a given entity.""" @JavaName remove remove :: Resource -> () @deprecated remove_ :: Resource -> () remove_ = remove