我有几个实体:
TranslationUnit
TranslationValue
区域设置
TranslationUnit 与 TranslationValue 具有多对多关系。
TranslationValue 具有 1-1 与区域设置。
语言环境具有有意义的字段 - jhi_value;
我需要做的是:选择那些 TranslationUnits,即:
1) 没有相关的 TranslationValues(这意味着 - 根本没有翻译) 2) 没有具有特定语言环境的 TranslationValues(例如,“en”)。
我为此构建了 SQL 查询,在我的 Postgres DB 中完美运行:
select * from translation_unit tu where not exists ( select null from translation_value tv join locale l on tv.locale_id =l.id where l.jhi_value='en' and tu.id=tv.translation_unit_id);
我需要为此构建规范(它将与其他现有规范相结合)。
感谢任何帮助。