These water heaters do in fact come with a cord attached. There was one installed at a former employer of mine and it came with the cord on it. While I don't know if it violates code at least it was plugged in to a GFCI outlet. Still kinda scared me though.
Ian