If i'm using hibernate, where does EJB comes in and what are the purposes served by them each?
EJB != persistence. Entity beans did, but they are long dead. EJBs containers cover a lot of the ground Spring does so you can integrate the two but the choice tends to be Spring or EJBs. See
this.