Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with base class will auto use the base class name as label #2933

Open
abccbaandy opened this issue Aug 6, 2024 · 0 comments
Open

Query with base class will auto use the base class name as label #2933

abccbaandy opened this issue Aug 6, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@abccbaandy
Copy link

abccbaandy commented Aug 6, 2024

I have a base class for common field

public abstract class BaseNode {
    @Id
    @GeneratedValue
    private UUID id;
}

My real node

@Node
public class MyNode extends BaseNode {
    @Relationship(type = "CONTAIN", direction = Relationship.Direction.OUTGOING)
    private List<BaseRelationship<BaseNode>> nodeList = new ArrayList<>();
}
@RelationshipProperties
public class BaseDbRelationship<T extends BaseNode> {
    @RelationshipId
    private Long id;
    @TargetNode
    private T node;
}

When I use repository to query the MyNode, it will show cypher like this

MATCH (myNode:`MyNode`) WHERE myNode.id = $__id__ OPTIONAL MATCH (myNode)-[__sr__:`CONTAIN`]->(__srn__:`BaseNode`) WITH collect(elementId(myNode)) AS __sn__, collect(elementId(__srn__)) AS __srn__, collect(elementId(__sr__)) AS __sr__ RETURN __sn__, __srn__, __sr__

And result nodeList is empty, because those node don't have BaseNode label.
Anyways to get rid of this feature?
I tried removed private UUID id; part but still not work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants