第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

Hibernate JPA 2 Metamodel Generator Turkish Char問題

Hibernate JPA 2 Metamodel Generator Turkish Char問題

慕蓋茨4494581 2023-04-13 17:22:47
   <dependency>        <groupId>org.hibernate</groupId>        <artifactId>hibernate-jpamodelgen</artifactId>        <version>6.0.0.Alpha2</version>    </dependency>當(dāng)我將 hibernate-jpamodelgen 依賴項(xiàng)添加到項(xiàng)目時(shí)。在編譯過程之前一切正常。我可以在目標(biāo)文件夾下看到生成的元模型類。但是由于我的系統(tǒng)默認(rèn)值(與我的操作系統(tǒng)相關(guān)),元模型類上的字段名稱常量轉(zhuǎn)換錯(cuò)誤。public static final String TRANST?ME = "transtime";public static final String NOTE = "note";public static final String ?SACT?VE = "isactive";-[ERROR] /C:/Users/*/IdeaProjects/*/target/generated-sources/annotations/*/model/acc/InvtypeView_.java:[20,37] illegal character: '\ufffd'這會導(dǎo)致編譯錯(cuò)誤。當(dāng)我分析代碼生成過程時(shí),我可以看到 org.hibernate.jpamodelgen.util.StringUtil 類的 getUpperUnderscoreCaseFromLowerCamelCase 方法導(dǎo)致了這個(gè)。public static String getUpperUnderscoreCaseFromLowerCamelCase(String lowerCamelCaseString){    return lowerCamelCaseString.replaceAll("(.)(\\p{Upper})", "$1_$2").toUpperCase();}toUpperCase 方法應(yīng)該有參數(shù) Locale.ROOT。我在Hibernate 問題跟蹤器系統(tǒng)上創(chuàng)建了一個(gè)問題。任何快速解決方案/解決方法都會很棒。
查看完整描述

3 回答

?
繁花不似錦

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超4個(gè)贊

我用以下配置解決了同樣的問題。


<plugin>

    <artifactId>maven-compiler-plugin</artifactId>

    <configuration>

        <source>${java.version}</source>

        <target>${java.version}</target>

        <fork>true</fork>

        <compilerArgs>

            <compilerArg>-J-Duser.language=en</compilerArg>

            <compilerArg>-J-Duser.country=US</compilerArg>

            <compilerArg>-J-Dfile.encoding=UTF-8</compilerArg>

        </compilerArgs>

        <annotationProcessorPaths>

            <annotationProcessorPath>

                <groupId>org.hibernate</groupId>

                <artifactId>hibernate-jpamodelgen</artifactId>

                <version>${hibernate.version}</version>

            </annotationProcessorPath>

        </annotationProcessorPaths>

    </configuration>

</plugin>


查看完整回答
反對 回復(fù) 2023-04-13
?
守候你守候我

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超10個(gè)贊

2023 年 3 月更新:

在您的項(xiàng)目中添加包含內(nèi)容的.mvn/jvm.config文件-Duser.country=US -Duser.language=en似乎會更改 Maven 的語言環(huán)境,這似乎是更好的方法。

2023 年 2 月更新:

經(jīng)過一些調(diào)試,下面是我對這個(gè)問題的發(fā)現(xiàn):

http://img4.sycdn.imooc.com/6437ca1c00013c8323530817.jpg

即使我的實(shí)體(編碼方式)沒有問題,JpaMetaModelGen 的 StringUtils 類方法使用 toUpperCase() 方法,該方法使用 JVM 的默認(rèn) Locale 進(jìn)行大寫操作。以下是一些關(guān)于 upperCase 方法的文檔:

此方法對區(qū)域設(shè)置敏感,如果用于旨在獨(dú)立解釋區(qū)域設(shè)置的字符串,可能會產(chǎn)生意外結(jié)果。示例是編程語言標(biāo)識符、協(xié)議密鑰和 HTML 標(biāo)記。例如,土耳其語言環(huán)境中的“title”.toUpperCase() 返回“T\u0130TLE”,其中“\u0130”是帶點(diǎn)的拉丁文大寫字母 I。要獲得不區(qū)分語言環(huán)境的字符串的正確結(jié)果,請使用 toUpperCase(Locale.ROOT)。

似乎我需要將我的 JVM 區(qū)域設(shè)置更改為英語(通常當(dāng)您調(diào)用 java 命令時(shí),您需要添加這些 jvm args:-Duser.country=US -Duser.language=en)以解決此問題,但添加這些to mvn 命令對我不起作用,所以在 IDEA 中我這樣做了,它似乎起作用了。

http://img2.sycdn.imooc.com/6437ca2800011b6421430688.jpg


查看完整回答
反對 回復(fù) 2023-04-13
?
墨色風(fēng)雨

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊

我有同樣的問題。我的問題已通過以下插件解決


<plugin>

            <inherited>true</inherited>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-compiler-plugin</artifactId>

            <version>${maven-compiler-plugin.version}</version>

            <configuration>

                <source>${java.version}</source>

                <target>${java.version}</target>

                <compilerArgument>-proc:none</compilerArgument>

                <encoding>UTF-8</encoding>

                <showWarnings>true</showWarnings>

                <showDeprecation>true</showDeprecation>


            </configuration>

        </plugin>


        <plugin>

            <groupId>org.bsc.maven</groupId>

            <artifactId>maven-processor-plugin</artifactId>

            <executions>

                <execution>

                    <goals>

                        <goal>process</goal>

                    </goals>

                    <phase>generate-sources</phase>

                    <configuration>

                        <compilerArguments>-AaddGeneratedAnnotation=false</compilerArguments> <!-- suppress java.annotation -->

                        <processors>

                            <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>

                        </processors>

                        <outputDirectory>generated</outputDirectory>

                    </configuration>

                </execution>

            </executions>

        </plugin>


查看完整回答
反對 回復(fù) 2023-04-13
  • 3 回答
  • 0 關(guān)注
  • 184 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號