A hydraulic mechanism, a motor or a pump, comprising: a cam; a cylinder block rotatably mounted relative to the cam; at least one cylinder arranged in the cylinder block, having an outer segment of a first diameter defining an outer chamber, and an inner segment of a second diameter smaller than the first diameter, defining an inner chamber; and at least one piston assembly suitable for cooperating with a cylinder, the piston assembly comprising: a piston slidably mounted inside said cylinder, having an outer portion of a first diameter and an inner portion of a second diameter smaller than the first diameter; a roller rotatably mounted on the piston and configured to co-operate with the cam, the roller being delimited by two transverse end faces; and wherein the inner segment of the cylinder has a groove arranged in its inside face, characterized in that it further comprises first and second shim parts, each arranged between a respective end face of the roller and the inside face of the cylinder against which said shim part bears so as to maintain the axial position of the roller; and in that the piston assembly includes a projection projecting from the inner portion of the piston, and configured to co-operate with the groove in the cylinder so as to maintain the orientation of the roller. a cam; a cylinder block rotatably mounted relative to the cam; at least one cylinder arranged in the cylinder block, having an outer segment of a first diameter defining an outer chamber, and an inner segment of a second diameter smaller than the first diameter, defining an inner chamber; and at least one piston assembly suitable for cooperating with a cylinder, the piston assembly comprising: a piston slidably mounted inside said cylinder, having an outer portion of a first diameter and an inner portion of a second diameter smaller than the first diameter; a roller rotatably mounted on the piston and configured to co-operate with the cam, the roller being delimited by two transverse end faces; and wherein the inner segment of the cylinder has a groove arranged in its inside face, characterized in that it further comprises first and second shim parts, each arranged between a respective end face of the roller and the inside face of the cylinder against which said shim part bears so as to maintain the axial position of the roller; and in that the piston assembly includes a projection projecting from the inner portion of the piston, and configured to co-operate with the groove in the cylinder so as to maintain the orientation of the roller. a piston slidably mounted inside said cylinder, having an outer portion of a first diameter and an inner portion of a second diameter smaller than the first diameter; a roller rotatably mounted on the piston and configured to co-operate with the cam, the roller being delimited by two transverse end faces; and wherein the inner segment of the cylinder has a groove arranged in its inside face, characterized in that it further comprises first and second shim parts, each arranged between a respective end face of the roller and the inside face of the cylinder against which said shim part bears so as to maintain the axial position of the roller; and in that the piston assembly includes a projection projecting from the inner portion of the piston, and configured to co-operate with the groove in the cylinder so as to maintain the orientation of the roller.