select tbl_LanguageData.Name As defaultLabel,
IsNull((Select Top 1 LanguageInfo From tbl_Language_TranslationInfo
Where tbl_Language_TranslationInfo.Languageid = 48
And tbl_Language_TranslationInfo.LanguageDataId = tbl_LanguageData.LanguageDataId),
tbl_LanguageData.Name) As localLang
from tbl_UILabels, tbl_LanguageData
Where tbl_UILabels.LanguageDataId = tbl_LanguageData.LanguageDataId
And menuid = 10100
答案 0 :(得分:0)
如果已经定义了持久性单元(存储库META-INF中的文件persistence.xml),则可以使用实体管理器和createNativeQuery方法
//declare the entity manager
EntityManager em = Persistence.createEntityManagerFactory("name of your persistence unit").createEntityManager();
String request = "your request";
Result result = em.createNativeQuery(request,Result.class).getResultList();