Spring JPA collectionResourceRel默认值?
使用JPA时,如果skip@RepositoryRestResource自动使api添加“s”Spring JPA collectionResourceRel默认值?,jpa,spring-boot,Jpa,Spring Boot,使用JPA时,如果skip@RepositoryRestResource自动使api添加“s” public interface deviceposition扩展了jpareposition{ } 以上代码由/api/设备api自动生成 public interface RadioDataRepository extends JpaRepository<RadioData, Integer> { } 公共接口RadioDataRepository扩展了JpaRepository{
public interface deviceposition扩展了jpareposition{
}
以上代码由/api/设备api自动生成
public interface RadioDataRepository extends JpaRepository<RadioData, Integer> {
}
公共接口RadioDataRepository扩展了JpaRepository{
}
但我不能使用/api/radiodata或/api/radiodata。这有规定吗
我知道使用如下注释
@RepositoryRestResource(collectionResourceRel = "rdata", path = "rdata")
public interface RadioDataRepository extends JpaRepository<RadioData, Integer> {
}
@RepositoryRestResource(collectionResourceRel=“rdata”,path=“rdata”)
公共接口RadioDataRepository扩展了JpaRepository{
}
但我是春季和JPA的新手。请让我知道这件事
谢谢
SpringDataREST公开了一个以
导出的域类的非资本化、多元化版本
存储库正在处理。资源的名称和路径都可以
可以使用存储库上的@RepositoryRestResource进行自定义
接口
默认情况下,导出器将使用
域类的名称。SpringDataREST也应用了这个词的复数形式
Evo拐点实现了基于
达米安·康威的论文
文档中有很多细节,但这似乎提供了形成名词复数形式的算法的良好概述:
1. Check if the user has defined an inflection for the noun, and , if so, accept that...
if the word matches a user-defined noun,
return the user-specified plural form
2. Handle words that do not inflect in the plural (such as fish, travois, chassis, nationalities ending in -ese etc. - see Tables A.2 and A.3)...
if suffix(-fish) or suffix(-ois) or suffix(-sheep)
or suffix(-deer) or suffix(-pox) or suffix(-[A-Z].*ese)
or suffix(-itis) or category(-,-),
return the original noun
3. Handle pronouns in the nominative, accusative, and dative (see Tables A.5), as well as prepositional phrases...
if the word is a pronoun,
return the specified plural of the pronoun
if the word is of the form: "<preposition> <pronoun>",
return "<preposition> <specified plural of pronoun>"
4. Handle standard irregular plurals (mongooses, oxen, etc. - see table A.1)...
if the word has an irregular plural,
return the specified plural
5. Handle irregular inflections for common suffixes (synopses, mice and men, etc.)...
if suffix(-man), return inflection(-man,-men)
if suffix(-[lm]ouse), return inflection(-ouse,-ice)
if suffix(-tooth), return inflection(-tooth,-teeth)
if suffix(-goose), return inflection(-goose,-geese)
if suffix(-foot), return inflection(-foot,-feet)
if suffix(-zoon), return inflection(-zoon,-zoa)
if suffix(-[csx]is), return inflection(-is,-es)
6. Handle fully assimilated classical inflections (vertebrae, codices, etc. - see tables A.10, A.14, A.19 and A.20, and tables A.11, A.15 and A.21 if in "classical mode)...
if category(-ex,-ices), return inflection(-ex,-ices)
if category(-um,-a), return inflection(-um,-a)
if category(-on,-a), return inflection(-on,-a)
if category(-a,-ae), return inflection(-a,-ae)
7. Handle classical variants of modern inflections (stigmata, soprani, etc. - see tables A.11 to A.13, A.15, A.16, A.18, A.21 to A.25)...
if in classical mode,
if suffix(-trix), return inflection(-trix,-trices)
if suffix(-eau), return inflection(-eau,-eaux)
if suffix(-ieu), return inflection(-ieu,-ieux)
if suffix(-..[iay]nx), return inflection(-nx,-nges)
if category(-en,-ina), return inflection(-en,-ina)
if category(-a,-ata), return inflection(-a,-ata)
if category(-is,-ides), return inflection(-is,-ides)
if category(-us,-i), return inflection(-us,-i)
if category(-us,-us), return the original noun
if category(-o,-i), return inflection(-o,-i)
if category(-,-i), return inflection(-,-i)
if category(-,-im), return inflection(-,-im)
8. The suffixes -ch, -sh, and -ss all take -es in the plural (churches, classes, etc)...
if suffix(-[cs]h), return inflection(-h,-hes)
if suffix(-ss), return inflection(-ss,-sses)
9. Certain words ending in -f or -fe take -ves in the plural (lives, wolves, etc)...
if suffix(-[aeo]lf) or suffix(-[^d]eaf) or suffix(-arf),
return inflection(-f,-ves)
if suffix(-[nlw]ife),
return inflection(-fe,-ves)
10. Words ending in -y take -ys if preceded by a vowel (storeys, stays, etc.) or when a proper noun (Marys, Tonys, etc.), but -ies if preceded by a consonant (stories, skies, etc.)...
if suffix(-[aeiou]y), return inflection(-y,-ys)
if suffix(-[A-Z].*y), return inflection(-y,-ys)
if suffix(-y), return inflection(-y,-ies)
11. Some words ending in -o take -os (lassos, solos, etc. - see tables A.17 and A.18); the rest take -oes (potatoes, dominoes, etc.) However, words in which the -o is preceded by a vowel always take -os (folios, bamboos)...
if category(-o,-os) or suffix(-[aeiou]o),
return inflection(-o,-os)
if suffix(-o), return inflection(-o,-oes)
12. Handle plurals of compound words (Postmasters General, Major Generals, mothers-in-law, etc) by recursively applying the entire algorithm to the underlying noun. See Table A.26 for the military suffix -general, which inflects to -generals...
if category(-general,-generals), return inflection(-l,-ls)
if the word is of the form: "<word> general",
return "<plural of word> general"
if the word is of the form: "<word> <preposition> <words>",
return "<plural of word> <preposition> <words>"
13. Otherwise, assume that the plural just adds -s (cats, programmes, trees, etc.)...
otherwise, return inflection(-,-s)
1。检查用户是否为名词定义了屈折变化,如果是,请接受。。。
如果单词与用户定义的名词匹配,
返回用户指定的复数形式
2.处理不以复数形式出现屈折变化的单词(如fish、travois、chassis、以-ese结尾的民族等-见表A.2和A.3)。。。
如果后缀(-fish)或后缀(-ois)或后缀(-sheep)
或后缀(-deer)或后缀(-pox)或后缀(-A-Z].*ese)
或后缀(-itis)或类别(-itis),
返回原名词
3.处理主格、宾格和与格中的代词(见表A.5)以及介词短语。。。
如果这个词是代词,
返回代词的指定复数形式
如果单词的形式为:“”,
返回“”
4.处理标准的不规则复数(猫鼬、牛等-见表A.1)。。。
如果这个词的复数形式不规则,
返回指定的复数形式
5.处理常见后缀(大纲、鼠标和人等)的不规则屈折变化。。。
if后缀(-man),返回词形变化(-man,-men)
如果后缀(-[lm]USE),则返回屈折变化(-USE,-ice)
如果后缀(-齿),返回屈折(-齿,-齿)
if后缀(-goose),返回词形变化(-goose,-geese)
如果后缀为(-foot),则返回屈折变化(-foot,-foots)
if后缀(-zoon),返回屈折变化(-zoon,-zoa)
如果后缀(-[csx]为,则返回屈折变化(-is,-es)
6.处理完全同化的经典屈折变化(椎骨、尾骨等——见表A.10、A.14、A.19和A.20,如果处于“经典模式”,则见表A.11、A.15和A.21)。。。
如果类别(-ex,-ices),返回屈折变化(-ex,-ices)
如果类别(-um,-a),返回屈折变化(-um,-a)
如果类别(-on,-a),返回屈折变化(-on,-a)
如果类别(-a,-ae),返回拐点(-a,-ae)
7.处理现代屈折变化的经典变体(柱头、高音等-见表A.11至A.13、A.15、A.16、A.18、A.21至A.25)。。。
如果在经典模式下,
if后缀(-trix),返回屈折(-trix,-trices)
if后缀(-eau),返回词形变化(-eau,-eaux)
if后缀(-ieu),返回词形变化(-ieu,-ieux)
如果后缀(-..[iay]nx),则返回屈折变化(-nx,-nges)
如果类别(-en,-ina),返回屈折变化(-en,-ina)
如果类别(-a,-ata),返回屈折(-a,-ata)
如果类别(-is,-ides),则返回屈折变化(-is,-ides)
如果类别(-us,-i),返回屈折变化(-us,-i)
如果是category(-us,-us),则返回原始名词
如果类别(-o,-i),返回屈折(-o,-i)
如果类别(--i),返回屈折变化(--i)
如果类别(--im),则返回词形变化(--im)
8.后缀-ch、-sh和-ss都是复数形式(教堂、班级等)。。。
如果后缀(-[cs]h),返回屈折(-h,-hes)
if后缀(-ss),返回拐点(-ss,-ss)
9.某些以-f或-fe结尾的单词采用复数形式(生命、狼等)。。。
如果后缀([aeo]lf)或后缀([^d]eaf)或后缀(-arf),
返回拐点(-f,-ves)
如果后缀(-[nlw]ife),
返回拐点(-fe,-ves)
10.以-y take-ys结尾的单词,如果前面有元音(stroys、stays等),或者是专有名词(Marys、Tonys等),如果前面有辅音(stories、skies等),则以-y take-ys结尾。。。
如果后缀(-[aeiou]y),则返回屈折变化(-y,-ys)
如果后缀(-[A-Z].*y),则返回屈折变化(-y,-ys)
if后缀(-y),返回屈折变化(-y,-ies)
11.一些以-o take-os结尾的单词(套索、独奏等-见表A.17和A.18);其余的take-oes(土豆、多米诺骨牌等)但是,在-o前面加元音的单词总是take-os(对开本、竹子)。。。
如果类别(-o,-os)或后缀(-aeiou]o),
返回拐点(-o,-os)
if后缀(-o),返回拐点(-o,-oes)
12.通过递归地将整个算法应用于基础名词来处理复合词的复数形式(邮政总局局长、少将、岳母等)。军事后缀-General的词形变化为-Generals,见表A.26。。。
如果类别(-general,-generals),返回拐点(-l,-ls)
如果单词的形式为“一般”,
返回“一般”
如果单词的形式为:“”,
返回“”
13.否则,假设t
1. Check if the user has defined an inflection for the noun, and , if so, accept that...
if the word matches a user-defined noun,
return the user-specified plural form
2. Handle words that do not inflect in the plural (such as fish, travois, chassis, nationalities ending in -ese etc. - see Tables A.2 and A.3)...
if suffix(-fish) or suffix(-ois) or suffix(-sheep)
or suffix(-deer) or suffix(-pox) or suffix(-[A-Z].*ese)
or suffix(-itis) or category(-,-),
return the original noun
3. Handle pronouns in the nominative, accusative, and dative (see Tables A.5), as well as prepositional phrases...
if the word is a pronoun,
return the specified plural of the pronoun
if the word is of the form: "<preposition> <pronoun>",
return "<preposition> <specified plural of pronoun>"
4. Handle standard irregular plurals (mongooses, oxen, etc. - see table A.1)...
if the word has an irregular plural,
return the specified plural
5. Handle irregular inflections for common suffixes (synopses, mice and men, etc.)...
if suffix(-man), return inflection(-man,-men)
if suffix(-[lm]ouse), return inflection(-ouse,-ice)
if suffix(-tooth), return inflection(-tooth,-teeth)
if suffix(-goose), return inflection(-goose,-geese)
if suffix(-foot), return inflection(-foot,-feet)
if suffix(-zoon), return inflection(-zoon,-zoa)
if suffix(-[csx]is), return inflection(-is,-es)
6. Handle fully assimilated classical inflections (vertebrae, codices, etc. - see tables A.10, A.14, A.19 and A.20, and tables A.11, A.15 and A.21 if in "classical mode)...
if category(-ex,-ices), return inflection(-ex,-ices)
if category(-um,-a), return inflection(-um,-a)
if category(-on,-a), return inflection(-on,-a)
if category(-a,-ae), return inflection(-a,-ae)
7. Handle classical variants of modern inflections (stigmata, soprani, etc. - see tables A.11 to A.13, A.15, A.16, A.18, A.21 to A.25)...
if in classical mode,
if suffix(-trix), return inflection(-trix,-trices)
if suffix(-eau), return inflection(-eau,-eaux)
if suffix(-ieu), return inflection(-ieu,-ieux)
if suffix(-..[iay]nx), return inflection(-nx,-nges)
if category(-en,-ina), return inflection(-en,-ina)
if category(-a,-ata), return inflection(-a,-ata)
if category(-is,-ides), return inflection(-is,-ides)
if category(-us,-i), return inflection(-us,-i)
if category(-us,-us), return the original noun
if category(-o,-i), return inflection(-o,-i)
if category(-,-i), return inflection(-,-i)
if category(-,-im), return inflection(-,-im)
8. The suffixes -ch, -sh, and -ss all take -es in the plural (churches, classes, etc)...
if suffix(-[cs]h), return inflection(-h,-hes)
if suffix(-ss), return inflection(-ss,-sses)
9. Certain words ending in -f or -fe take -ves in the plural (lives, wolves, etc)...
if suffix(-[aeo]lf) or suffix(-[^d]eaf) or suffix(-arf),
return inflection(-f,-ves)
if suffix(-[nlw]ife),
return inflection(-fe,-ves)
10. Words ending in -y take -ys if preceded by a vowel (storeys, stays, etc.) or when a proper noun (Marys, Tonys, etc.), but -ies if preceded by a consonant (stories, skies, etc.)...
if suffix(-[aeiou]y), return inflection(-y,-ys)
if suffix(-[A-Z].*y), return inflection(-y,-ys)
if suffix(-y), return inflection(-y,-ies)
11. Some words ending in -o take -os (lassos, solos, etc. - see tables A.17 and A.18); the rest take -oes (potatoes, dominoes, etc.) However, words in which the -o is preceded by a vowel always take -os (folios, bamboos)...
if category(-o,-os) or suffix(-[aeiou]o),
return inflection(-o,-os)
if suffix(-o), return inflection(-o,-oes)
12. Handle plurals of compound words (Postmasters General, Major Generals, mothers-in-law, etc) by recursively applying the entire algorithm to the underlying noun. See Table A.26 for the military suffix -general, which inflects to -generals...
if category(-general,-generals), return inflection(-l,-ls)
if the word is of the form: "<word> general",
return "<plural of word> general"
if the word is of the form: "<word> <preposition> <words>",
return "<plural of word> <preposition> <words>"
13. Otherwise, assume that the plural just adds -s (cats, programmes, trees, etc.)...
otherwise, return inflection(-,-s)