Fixing Null EntityManger in Spring MVC application?

后端 未结 4 1776
逝去的感伤
逝去的感伤 2020-12-09 06:49

In the following code I am trouble with my injected EnitityManager, which always shows up as null;

public class GenericController extends Ab         


        
4条回答
  •  甜味超标
    2020-12-09 07:12

    I think you need a file persistence.xml:

    
    
    
      
         com.domain.MyClass
      
    
    
    

    I think it will not work if the file has a different name, especially not since you don't tell the EntityManager factory the new name anywhere.

提交回复
热议问题