spring+hibernate mapping class without xml

前端 未结 4 1193
不知归路
不知归路 2021-02-03 10:58

in my applicationContext.xml, this is how I map xml to POJO. how to map directory to class file without required to create xml?



        
4条回答
  •  自闭症患者
    2021-02-03 11:54

    You can use annotations on your class, though for Hibernate I'm not sure there's something built in (for use in Spring). This thread should help if yo want to avoid yet more technology, but you could also use Java Persistence Annotations (JPA) in concert with Hibernate to accomplish the same goal.

    Here's a good tutorial for using JPA + Hibernate + Spring.

提交回复
热议问题