Summary
--emit neo4j assigns every :JField node the id <ownerFqn>#field#null, so all fields of a class collapse into a single :JField node (the unique-constraint MERGE keeps only the last). Field data is almost entirely lost.
Environment
Impact
Measured on the daytrader8 sample (level 2): all 122 :JField nodes in the database have an id ending in #field#null, and every one has name = null. A class with 17 fields (e.g. XMLObject, RunStatsDataBean) ends up with a single :JField node. Any consumer reading fields from the graph (e.g. the CLDK SDK's read-only Java backend) gets one field per class instead of all of them.
MATCH (f:JField) WHERE f.id ENDS WITH '#field#null' RETURN count(f); // 122 (== total JField count)
MATCH (:JType {id:'...XMLObject'})-[:J_HAS_FIELD]->(f:JField) RETURN f.id;
// -> '...XMLObject#field#null' (a single node; ref analysis.json has 17 field_declarations)
Root cause
neo4j/GraphProjector.java, projectField:
String id = ownerFqn + "#field#" + f.getName();
A Java field declaration is keyed by its variables list, not a single name — Field.getName() is null here (the model has no scalar field name; the projected node even sets "name", f.getName() ⇒ null). So every field's id is <fqn>#field#null, and the j_field_id uniqueness constraint collapses them on MERGE.
Suggested fix
Key the field id by something unique per declaration — e.g. the first variable name, the joined variables, or a positional index:
String key = (f.getVariables() != null && !f.getVariables().isEmpty())
? String.join("+", f.getVariables())
: String.valueOf(index);
String id = ownerFqn + "#field#" + key;
(and project the real field name/variables so they round-trip).
Summary
--emit neo4jassigns every:JFieldnode the id<ownerFqn>#field#null, so all fields of a class collapse into a single:JFieldnode (the unique-constraintMERGEkeeps only the last). Field data is almost entirely lost.Environment
Impact
Measured on the daytrader8 sample (level 2): all 122
:JFieldnodes in the database have an id ending in#field#null, and every one hasname = null. A class with 17 fields (e.g.XMLObject,RunStatsDataBean) ends up with a single:JFieldnode. Any consumer reading fields from the graph (e.g. the CLDK SDK's read-only Java backend) gets one field per class instead of all of them.Root cause
neo4j/GraphProjector.java,projectField:A Java field declaration is keyed by its
variableslist, not a singlename—Field.getName()isnullhere (the model has no scalar field name; the projected node even sets"name", f.getName()⇒null). So every field's id is<fqn>#field#null, and thej_field_iduniqueness constraint collapses them onMERGE.Suggested fix
Key the field id by something unique per declaration — e.g. the first variable name, the joined
variables, or a positional index:(and project the real field
name/variablesso they round-trip).