Resistive switching in nanometric BaTiO3 ferroelectric junctions