tengo dos clases en mi proyecto que son:
- Perfil
- Usuarios
que esas clases son nombres de tablas en mi base de datos que esta en Mysql.
ahora bien los campos de mis tablas EN LA BASE DE DATOS, son los siguientes:
tabla perfil:
Código PHP:
   idperfil
tipoperfil 
    Código PHP:
   idusuarios
nombre
a_paterno
a_materno
usuario
clave
fk_idperfil 
    Ahora bien pongo mi clase Perfil ya esto es codigo java:
Perfil.java
Código PHP:
   @Entity
@Table(name="perfil")
public class Perfil {
    @Id
    @GeneratedValue
    private Integer idperfil;
    private String tipoperfil;
    
    @OneToMany (cascade = CascadeType.ALL , mappedBy = "perfil" )
    private List<Usuarios> usuarios;
    
    public Perfil (  Integer idperfil, String tipoperfil )
    {
         this.idperfil=idperfil;
         this.tipoperfil=tipoperfil;
    }
                //Setters and getters 
    Código PHP:
   @Entity
@Table(name="usuarios")
public class Usuarios {
    @Id
    @GeneratedValue
    private Integer idusuarios;
    private String nombre;
    private String a_paterno;
    private String a_materno;
    private String usuario;
    private String clave;
    
     
    @ManyToOne
    @JoinColumn(name="fk_idperfil" , nullable = false)
        private Usuarios usuarios;
    
    
    public Usuarios (Integer idusuarios, String nombre, String a_paterno, String a_materno, String usuario, String clave)
    {
        this.idusuarios= idusuarios;
        this.nombre=nombre;
        this.a_paterno= a_paterno;
        this.a_materno=a_materno;
        this.usuario=usuario;
        this.clave=clave;
        
         
    }
                     //Setters and getters 
    Código PHP:
   org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.main.dto.Usuarios.perfil in com.main.dto.Perfil.usuarios 
     
 


