Constructors and parameters
Constructors create instances; methods and constructors share ResolvedParameter, which carries the parameter's name, its resolved type and its annotations.
findConstructor and newInstance
findConstructor finds a public constructor of the class by its parameter classes, findDeclaredConstructor any constructor, private ones included. newInstance passes the arguments in order.
classOf[Long] is the primitive long, which is what the constructor declares. Pass boxed values such as Long.box(1L) to newInstance.
Names, types and annotations
Parameter names come from the class file. Scala 3 writes them by default; Java classes need javac -parameters, otherwise the names are arg0, arg1 and so on.
parameterType is resolved against the owning class, so a parameter of a generic base method reads as the concrete type in the subclass. For method parameters, annotations also include those of the same parameter in overridden methods.
What frameworks usually need
Mappers create an empty instance and fill it through properties. That needs a public constructor without parameters.