I can't find anything that says how the Type 212 submarines store hydrogen. After thinking about it though, I think they must be using metal hydride storage. Submarines already have to be ballasted to offset the buoyancy of the crew compartment, and given the low density of liquid hydrogen, they'd need ballast to offset that too. Liquid oxygen is slightly more dense than water, but not enough to offer much compensation.
It seems like you could use the metal hydride batteries as your primary ballast that you'd need anyway, and get the hydrogen storage pretty much for free (in the weight and volume sense, anyway).