Customize JPA field name mapping using EclipseLink

后端 未结 4 1823
名媛妹妹
名媛妹妹 2021-01-12 16:01

I need to map camel-case names to underscore-separated names in my current project, which uses EclipseLink, due to historical reasons. I know we can customize name mapping i

4条回答
  •  走了就别回头了
    2021-01-12 16:26

    Instead of

    directMapping.setFieldName(nameMap.get(oldFieldName ));
    

    try:

    directMapping.getField().resetQualifiedName(nameMap.get(oldFieldName));
    

    This does the trick for me under EclipseLink 2.5.0

提交回复
热议问题