Skip to content

Commit

Permalink
Deprecate GraphId annotation. (#426)
Browse files Browse the repository at this point in the history
Mark GraphId as deprecated and advise to use the Id annotation. 

Also apply import formatter.
Fixes #417
  • Loading branch information
meistermeier authored and nmervaillie committed Oct 20, 2017
1 parent 83292c2 commit 327ef0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion core/src/main/java/org/neo4j/ogm/annotation/GraphId.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

package org.neo4j.ogm.annotation;

import java.lang.annotation.*;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Identifies the field in the domain entity which is to be
Expand All @@ -22,7 +26,10 @@
* field called id.
*
* @author Vince Bickers
* @deprecated Just replace {@link GraphId} with {@link Id} and {@link GeneratedValue}.
* By default the {@link org.neo4j.ogm.id.InternalIdStrategy} will be used.
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Inherited
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ If the field of type `Long` is simply named 'id' then it is not necessary to ann
== @GraphId: Neo4j id field

The `@GraphId` annotation is superseded by `@Id @GeneratedValue` and exists for backwards compatibility.
It will be eventually deprecated and removed.
It is deprecated and will eventually be removed.

[WARNING]
***Do not*** rely on this ID for long running applications. Neo4j will reuse deleted node ID's. It is recommended users come up with their own
Expand Down

0 comments on commit 327ef0d

Please sign in to comment.