Skip to content

Commit c208dbb

Browse files
committed
add javadocs
1 parent 1533f01 commit c208dbb

File tree

5 files changed

+236
-0
lines changed

5 files changed

+236
-0
lines changed

src/main/java/com/marklogic/client/pojo/annotation/GeospatialLatitude.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,60 @@
1818
import java.lang.annotation.Retention;
1919
import java.lang.annotation.RetentionPolicy;
2020

21+
/** Use this annotation in combination with {@link GeospatialLongitude} on a
22+
* sibling property to specify that a Geospatial Element Pair Index should
23+
* be created for these pojo properties. The value should follow the rules
24+
* for any Geospatial Element Pair Index in MarkLogic Server with coordinate
25+
* system "wgs84".
26+
*
27+
* This annotation can be associated with a public field:
28+
* <pre> import com.marklogic.client.pojo.annotation.GeospatialLatitude;
29+
* import com.marklogic.client.pojo.annotation.GeospatialLongitude;
30+
* public class MyClass {
31+
* <b>{@literal @}GeospatialLatitude</b>
32+
* public String latitude;
33+
* {@literal @}GeospatialLongitude
34+
* public String longitude;
35+
* }</pre>
36+
*
37+
* or with a public getter method:
38+
* <pre>
39+
* public class MyClass {
40+
* private String latitude;
41+
* private String longitude;
42+
* <b>{@literal @}GeospatialLatitude</b>
43+
* public String getLatitude() {
44+
* return latitude;
45+
* }
46+
* {@literal @}GeospatialLongitude
47+
* public String getLongitude() {
48+
* return longitude;
49+
* }
50+
* // ... setter methods ...
51+
* }</pre>
52+
*
53+
* or with a public setter method:
54+
* <pre>
55+
* public class MyClass {
56+
* private String latitude;
57+
* private String longitude;
58+
*
59+
* // ... getter methods ...
60+
*
61+
* <b>{@literal @}GeospatialLatitude</b>
62+
* public void setLatitude(String latitude) {
63+
* this.latitude = latitude;
64+
* }
65+
* {@literal @}GeospatialLongitude
66+
* public void setLongitude(String longitude) {
67+
* this.longitude = longitude;
68+
* }
69+
* }</pre>
70+
* Run
71+
* {@link com.marklogic.client.pojo.util.GenerateIndexConfig} to generate
72+
* a package that can be used by administrators to create the indexes in
73+
* MarkLogic Server.
74+
*/
2175
@Retention(RetentionPolicy.RUNTIME)
2276
public @interface GeospatialLatitude {
2377
}

src/main/java/com/marklogic/client/pojo/annotation/GeospatialLongitude.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,60 @@
1818
import java.lang.annotation.Retention;
1919
import java.lang.annotation.RetentionPolicy;
2020

21+
/** Use this annotation in combination with {@link GeospatialLatitude} on a
22+
* sibling property to specify that a Geospatial Element Pair Index should
23+
* be created for these pojo properties. The value should follow the rules
24+
* for any Geospatial Element Pair Index in MarkLogic Server with coordinate
25+
* system "wgs84".
26+
*
27+
* This annotation can be associated with a public field:
28+
* <pre> import com.marklogic.client.pojo.annotation.GeospatialLatitude;
29+
* import com.marklogic.client.pojo.annotation.GeospatialLongitude;
30+
* public class MyClass {
31+
* {@literal @}GeospatialLatitude
32+
* public String latitude;
33+
* <b>{@literal @}GeospatialLongitude</b>
34+
* public String longitude;
35+
* }</pre>
36+
*
37+
* or with a public getter method:
38+
* <pre>
39+
* public class MyClass {
40+
* private String latitude;
41+
* private String longitude;
42+
* {@literal @}GeospatialLatitude
43+
* public String getLatitude() {
44+
* return latitude;
45+
* }
46+
* <b>{@literal @}GeospatialLongitude</b>
47+
* public String getLongitude() {
48+
* return longitude;
49+
* }
50+
* // ... setter methods ...
51+
* }</pre>
52+
*
53+
* or with a public setter method:
54+
* <pre>
55+
* public class MyClass {
56+
* private String latitude;
57+
* private String longitude;
58+
*
59+
* // ... getter methods ...
60+
*
61+
* {@literal @}GeospatialLatitude
62+
* public void setLatitude(String latitude) {
63+
* this.latitude = latitude;
64+
* }
65+
* <b>{@literal @}GeospatialLongitude</b>
66+
* public void setLongitude(String longitude) {
67+
* this.longitude = longitude;
68+
* }
69+
* }</pre>
70+
* Run
71+
* {@link com.marklogic.client.pojo.util.GenerateIndexConfig} to generate
72+
* a package that can be used by administrators to create the indexes in
73+
* MarkLogic Server.
74+
*/
2175
@Retention(RetentionPolicy.RUNTIME)
2276
public @interface GeospatialLongitude {
2377
}

src/main/java/com/marklogic/client/pojo/annotation/GeospatialPathIndexProperty.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,46 @@
1818
import java.lang.annotation.Retention;
1919
import java.lang.annotation.RetentionPolicy;
2020

21+
/** Use this annotation to specify that a Geospatial Path Index should
22+
* be created for this pojo property. The value should follow the rules
23+
* for any Geospatial Path Index in MarkLogic Server with coordinate
24+
* system "wgs84" and point format "point". Specifically, the value
25+
* should be in "{latititude} {longitude}" point format where {latitude}
26+
* and {longitude} are numeric geospatial wgs84 position values.
27+
*
28+
* This annotation can be associated with a public field:
29+
* <pre> import com.marklogic.client.pojo.annotation.GeospatialPathIndexProperty;
30+
* public class MyClass {
31+
* <b>{@literal @}GeospatialPathIndexProperty</b>
32+
* public String myGeoProperty;
33+
* }</pre>
34+
*
35+
* or with a public getter method:
36+
* <pre>
37+
* public class MyClass {
38+
* private String myGeoProperty;
39+
* <b>{@literal @}GeospatialPathIndexProperty</b>
40+
* public String getMyGeoProperty() {
41+
* return myGeoProperty;
42+
* }
43+
* // ... setter methods ...
44+
* }</pre>
45+
*
46+
* or with a public setter method:
47+
* <pre>
48+
* public class MyClass {
49+
* private String myGeoProperty;
50+
* // ... getter methods ...
51+
* <b>{@literal @}GeospatialPathIndexProperty</b>
52+
* public void setMyGeoProperty(String myGeoProperty) {
53+
* this.myGeoProperty = myGeoProperty;
54+
* }
55+
* }</pre>
56+
* Run
57+
* {@link com.marklogic.client.pojo.util.GenerateIndexConfig} to generate
58+
* a package that can be used by administrators to create the indexes in
59+
* MarkLogic Server.
60+
*/
2161
@Retention(RetentionPolicy.RUNTIME)
2262
public @interface GeospatialPathIndexProperty {
2363
}

src/main/java/com/marklogic/client/pojo/annotation/Id.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,52 @@
1717

1818
import java.lang.annotation.Retention;
1919
import java.lang.annotation.RetentionPolicy;
20+
import com.marklogic.client.pojo.PojoRepository;
2021

22+
/** Use this annotation to specify the Id property for each pojo class.
23+
* To work properly with {@link PojoRepository#write PojoRepository.write},
24+
* each pojo class must have one and only one property annotated with
25+
* the Id annotation. The property annotated with Id is used to
26+
* generate a unique URI in MarkLogic Server
27+
* for each persisted instance, and thus should be a property with a
28+
* unique value for each instance. <br><br>
29+
*
30+
* This annotation can be associated with a public field:
31+
* <pre> import com.marklogic.client.pojo.annotation.Id;
32+
* public class MyClass {
33+
* <b>{@literal @}Id</b>
34+
* public Long myId;
35+
* }</pre>
36+
*
37+
* or with a public getter method:
38+
* <pre>
39+
* public class MyClass {
40+
* private Long myId;
41+
* <b>{@literal @}Id</b>
42+
* public Long getMyId() {
43+
* return myId;
44+
* }
45+
* // ... setter methods ...
46+
* }</pre>
47+
*
48+
* or with a public setter method:
49+
* <pre>
50+
* public class MyClass {
51+
* private Long myId;
52+
*
53+
* // ... getter methods ...
54+
*
55+
* <b>{@literal @}Id</b>
56+
* public void setMyId(Long myId) {
57+
* this.myId = myId;
58+
* }
59+
* }</pre>
60+
*
61+
* This annotation is used only at
62+
* runtime to generate unique uris, so there is no need to run
63+
* {@link com.marklogic.client.pojo.util.GenerateIndexConfig} to do
64+
* anything with this annotation.
65+
*/
2166
@Retention(RetentionPolicy.RUNTIME)
2267
public @interface Id {
2368
}

src/main/java/com/marklogic/client/pojo/annotation/PathIndexProperty.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,49 @@
1818
import java.lang.annotation.Retention;
1919
import java.lang.annotation.RetentionPolicy;
2020

21+
/** Use this annotation to specify that a Path Index (required for range
22+
* queries) should be created for this pojo property. A path index is
23+
* used rather than an element range index because we can restrict matches
24+
* to only properties that are direct children of this class type. We
25+
* do this by including the class name in the path specification on the
26+
* path index.
27+
*
28+
* This annotation can be associated with a public field:
29+
* <pre> import com.marklogic.client.pojo.annotation.PathIndexProperty;
30+
* public class MyClass {
31+
* <b>{@literal @}PathIndexProperty</b>
32+
* public Long myLongValue;
33+
* }</pre>
34+
*
35+
* or with a public getter method:
36+
* <pre>
37+
* public class MyClass {
38+
* private Long myLongValue;
39+
* <b>{@literal @}PathIndexProperty</b>
40+
* public Long getMyLongValue() {
41+
* return myLongValue;
42+
* }
43+
* // ... setter methods ...
44+
* }</pre>
45+
*
46+
* or with a public setter method:
47+
* <pre>
48+
* public class MyClass {
49+
* private Long myLongValue;
50+
*
51+
* // ... getter methods ...
52+
*
53+
* <b>{@literal @}PathIndexProperty</b>
54+
* public void setMyLongValue(Long myLongValue) {
55+
* this.myLongValue = myLongValue;
56+
* }
57+
* }</pre>
58+
* Run
59+
* {@link com.marklogic.client.pojo.util.GenerateIndexConfig} to generate
60+
* a package that can be used by administrators to create the indexes in
61+
* MarkLogic Server.
62+
* @see com.marklogic.client.pojo.PojoQueryBuilder#range
63+
*/
2164
@Retention(RetentionPolicy.RUNTIME)
2265
public @interface PathIndexProperty {
2366
ScalarType scalarType();

0 commit comments

Comments
 (0)