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

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

Neo4j 的 Spring Date Repository 和“isEmpty”查詢拋出

Neo4j 的 Spring Date Repository 和“isEmpty”查詢拋出

慕森卡 2023-05-24 16:10:00
我在 Neo4j 數(shù)據(jù)庫(kù)中有以下實(shí)體:public class CompetencyEntity {    @GeneratedValue(strategy = UuidStrategy.class)    @Id    private String id;    @Property    private String name;    @Relationship(type = "PARENT_OF", direction = Relationship.OUTGOING)    private List<CompetencyEntity> children;    @Relationship(type = "PARENT_OF", direction = Relationship.INCOMING)            private List<CompetencyEntity> parents;    public void setParentOf(CompetencyEntity competency) {        children.add(competency);    }    public void setNotParentOf(CompetencyEntity competency) {        children.removeIf(comp -> comp.id.equals(competency.id));    }}我想查詢數(shù)據(jù)庫(kù),以便它返回所有沒(méi)有定義父項(xiàng)的實(shí)體。我想使用@Repository界面自動(dòng)生成的查詢來(lái)完成它。這樣做可以讓我輕松添加@Depth參數(shù)。我的存儲(chǔ)庫(kù)如下:@Repositorypublic interface CompetencyRepository        extends Neo4jRepository<CompetencyEntity, String>, CrudRepository<CompetencyEntity, String> {    Set<CompetencyEntity> findByNameRegex(String name);    @Query("MATCH (n:CompetencyEntity) WHERE NOT (n)<-[:PARENT_OF]-(:CompetencyEntity) RETURN n")    Set<CompetencyEntity> findRootCompetencies();    @Query("MATCH (n:CompetencyEntity) WHERE NOT (:CompetencyEntity)<-[:PARENT_OF]-(n) RETURN n")    Set<CompetencyEntity> findChildrenCompetencies();    Set<CompetencyEntity> findByChildrenEmpty();    Set<CompetencyEntity> findByParentsEmpty();}查詢findRootCompetencies確實(shí)有效。但是當(dāng)我嘗試findByParentsEmpty()(應(yīng)該意味著“找到被調(diào)用的列表parents為空的實(shí)體)方法時(shí),它會(huì)拋出以下內(nèi)容Exception
查看完整描述

1 回答

?
精慕HU

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

沒(méi)有針對(duì)關(guān)系的派生查找器方法的內(nèi)置功能。他們都只關(guān)注工作(圖形)屬性。

isEmptyspring Data Neo4j 不支持 special 中的關(guān)鍵字。附錄描述了在實(shí)現(xiàn)中可能不同的一般 Spring Data 行為。

但是,請(qǐng)查閱特定于商店的文檔以獲取支持的返回類型的確切列表,因?yàn)樘囟ㄉ痰昕赡懿恢С执颂幜谐龅哪承╊愋汀?/p>

查看完整回答
反對(duì) 回復(fù) 2023-05-24
  • 1 回答
  • 0 關(guān)注
  • 124 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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