A cyclic amine derivative represented by the formula (II) is a GPR119 agonist, and is used as an agent for treating diabetes.wherein Ar0 is phenyl or phenyl having a substituent such as C1-8 alkylsulfonyl or the like, pyridyl, or pyridyl having a substituent such as C1-8 alkylsulfonyl A0 is (CH2)p, O, or the like B0 is (CH2)q, or the like, provided that B0 is neither O nor NR25 when A0 is O or NR24 one of U0 and V0 is N, and the other is N or CR26 each of X0 and Y0 is C1-3 alkylene or C1-3 alkylene having a substituent R23 is a C1-8 alkyl group or the like each of R21 and R22 is hydrogen, a halogen atom, or the like.