Temporal get and set methods patch

The generated getters and setters for temporal fields can cause invalid type exceptions to be thrown in common MySQL scenarios. This patch tests the passed parameter type first which fixes the problem.