The index uses the class name.

I agree on the issues with the refactorings.

The problem is that you would have to keep a history of class names which is 
also annoying and can break.

So you suggest that we introduce a facility that maps classes to other names.
like.
This could also be used for index names and other places.
We probably have to add a component-scan at startup to collect all this 
information to have it available but that should be possible. So for every run 
we have the information type -> fully qualified classname.

@NodeEntity(type="u")
class Person {
}

after refactoring:

@NodeEntity(type="u")
class User {
}

Sounds good, will do it. Can you create two JIRA tickets for this and the 
@Indexed(level).

Thanks for the suggestions

Michael

Am 13.09.2011 um 11:50 schrieb Gonfi den Tschal:

> (maybe this was discussed before, or I'm completely wrong, couldn't
> find anything about it)
> 
> The __type__ string currently stores the fully qualified class name.
> 
> This has 2 drawbacks for me:
> 
> 1) it's looooooong.
> In my case, having millions of small objects, the __type__ attribute
> blows up the disk storage size (gigabytes).
> (maybe i should not be using sdg for this use case at all?)
> 
> 2) refactoring. moving the class breaks lookup, renaming the class
> breaks lookup.
> 
> 
> As I remember it is problematic or impossible to use two different
> @NodeEntity classes with the same
> class name (eg "Employee") in another package. I don't remember where
> I saw that, maybe I'm wrong.
> If that is the case then the __type__ could just store the simple
> class name (and have a map somewhere
> to find the original class again).
> 
> 
> Suggestion:
> An attribute on @NodeEntity and @RelationshipEntity to use just the
> simple class name "useShortClassName=true",
> or an attribute to specify the value for the __type__field explicitly
> like typename="foo".
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to