javaservlethibernatemysqljsp
I would like to ask, the primary and foreign key relationships have been established in the Mysql database. Do I still need to establish one-to-many and many-to-one association mappings in the persistence class in MyEclipse? If you want to establish an association mapping, how do you do it? The persistence class is handwritten by me, not automatically generated. Urgent! Waiting online! ! ! !
It can be implemented by using annotations. Add corresponding annotations (@Table(name="table name"), @Column(name="field name"), @OneToOne, @OneToMany... to the entity class corresponding to the database table. . .
Yes, you are using Hibernate, so you can use hibernate’s object relational mapping to handle configuration, one-to-many, many-to-many, etc. relationshipsHibernate Object Persistence Framework
[Persistence Framework] Comparison between Mybatis and Hibernate
Internship Summary (8) ---Persistence Framework Hibernate
------------------ ---Hello comrade, I am Xiao N, the CSDN question and answer robot. I am ordered by the organization to provide you with reference answers. The programming has not been successful yet, comrade still needs to work hard!
You still need to configure it. There are primary and foreign keys in your database. When you use the tool to reversely generate them, they will be automatically configured for you, but manual configuration still needs to be written in.