Closed sergeily closed 4 years ago
(Sorry for the repetition of my comment on #214) Could you give an example for an use-case? In general it might make more sense to create a relationship to another node holding those informations. Dynamic properties are just a unsorted set of informations that somehow work around the idea of object mapping.
Hi,
For each node we have explicit properties and auxiliary properties and we prefer to store these auxiliary properties as a separate collection.
When we use SDN+OGM it's possible to configure entity like
@NodeEntity(label="Column")
public class DaeColumnNode extends DaeNode {
......
private String name;
......
@Properties(prefix = "properties", allowCast = true)
private Map<String, Object> properties;
......
}
And when we save node to neo4j Map<String, Object>
would be save with prefix
name: columnNode2
properties.port: 8080
properties.timeZone: America/New_York
Hi.
That's a feature a lot of people like, actually. We are not against it either. Currently there seems to be work to have some similar in Spring Data commons. We will discuss this with Pivotal / VMWare.
Thank you!
We have been thinking about having something more similar to @Embedded
to have those properties in a domain specific, structured way. That would also remove the need for a context to see what properties are in the database and which are in the domain to keep them in sync.
This is quite good. I have stuff that needs translation, and I tried Map<String,String> to have something like
{
"en": "Stuff",
"sv": "Objekt"
}
but it didn't work and as a temp workaround I added
data class LangThing (val en: String, val sv: String)
However, you can see the limitation of supporting every language would mean manually writing each field. There's some more stuff which I'd like dynamic as I take it as JSON from other servers and don't care about them just show them to the user.
Now I realised that you guys use Map<String,Object> for dynamic relationships If you use something as suggested @Embedded
then:
I suggest maybe @EmbeddedNode
or @EmbeddedObject
as I think I saw some @Embedded
annotations before used by other frameworks in Java or I might be mistaking.
Since we are in a migration process to the original Spring Data Neo4j and have to archive this repository, the issue also go migrated to: https://jira.spring.io/browse/DATAGRAPH-1347 Please watch or comment on the issue in Jira for further communication.
it would be great to have dynamic-properties option such as OGM annotation @Properties
ogm-manual