<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def max(cls):
 """Get max record identifier."""

        max_recid = db.session.query(func.max(cls.recid)).scalar()
        return max_recid if max_recid else 0