Recently I have seen two definition of a generator module:

1) A generator for a category $C$ is an object $G$ such that for any two parallel morphisms $f,g:X \rightarrow Y$ with $f \neq g$, then there is a morphism $h: G \rightarrow X$ such that $fh \neq gh$. If we choose $C$ to be a module category, we get a definition of a generator module;

2)A module $X$ over an algebra $A$ is called a generator if $add(A) \subseteq add(X)$.

So are the two definitions equivalent? Thank you.