Skip to content

Commit 8bb1df4

Browse files
committed
shorter @generated (no more "hash = ")
1 parent 50e7ae7 commit 8bb1df4

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

objectbox-java-api/src/main/java/io/objectbox/annotation/Generated.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
@Retention(RetentionPolicy.CLASS)
1616
@Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD})
1717
public @interface Generated {
18-
int hash() default -1;
18+
/** A hash to identify the generated code */
19+
int value() default -1;
1920
}

tests/objectbox-java-test/src/main/java/io/objectbox/index/model/EntityLongIndex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public class EntityLongIndex {
1919
Float float4;
2020
Float float5;
2121

22-
@Generated(hash = 37687253)
22+
@Generated(37687253)
2323
public EntityLongIndex() {
2424
}
2525

26-
@Generated(hash = 2116856237)
26+
@Generated(2116856237)
2727
public EntityLongIndex(long id, long indexedLong, Float float1, Float float2, Float float3, Float float4, Float float5) {
2828
this.id = id;
2929
this.indexedLong = indexedLong;

tests/objectbox-java-test/src/main/java/io/objectbox/relation/Customer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ public class Customer {
2929

3030
/** Used to resolve relations */
3131
@Internal
32-
@Generated(hash = 1307364262)
32+
@Generated(1307364262)
3333
transient BoxStore __boxStore;
3434

35-
@Generated(hash = 60841032)
35+
@Generated(60841032)
3636
public Customer() {
3737
}
3838

39-
@Generated(hash = 1039711609)
39+
@Generated(1039711609)
4040
public Customer(long id, String name) {
4141
this.id = id;
4242
this.name = name;
@@ -62,7 +62,7 @@ public void setName(String name) {
6262
* To-many relationship, resolved on first access (and after reset).
6363
* Changes to to-many relations are not persisted, make changes to the target entity.
6464
*/
65-
@Generated(hash = 954185799)
65+
@Generated(954185799)
6666
public List<Order> getOrders() {
6767
if (orders == null) {
6868
final BoxStore boxStore = this.__boxStore;
@@ -82,7 +82,7 @@ public List<Order> getOrders() {
8282
}
8383

8484
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
85-
@Generated(hash = 1446109810)
85+
@Generated(1446109810)
8686
public synchronized void resetOrders() {
8787
orders = null;
8888
}

tests/objectbox-java-test/src/main/java/io/objectbox/relation/Order.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ public class Order {
2626

2727
/** @Depreacted Used to resolve relations */
2828
@Internal
29-
@Generated(hash = 975972993)
29+
@Generated(975972993)
3030
transient BoxStore __boxStore;
3131
@Internal
32-
@Generated(hash = 1031210392)
32+
@Generated(1031210392)
3333
transient ToOne<Customer> customer__toOne = new ToOne<>(this, Order_.customer);
3434

35-
@Generated(hash = 1105174599)
35+
@Generated(1105174599)
3636
public Order() {
3737
}
3838

3939
public Order(Long id) {
4040
this.id = id;
4141
}
4242

43-
@Generated(hash = 10986505)
43+
@Generated(10986505)
4444
public Order(long id, java.util.Date date, long customerId, String text) {
4545
this.id = id;
4646
this.date = date;
@@ -85,14 +85,14 @@ public Customer peekCustomer() {
8585
}
8686

8787
/** To-one relationship, resolved on first access. */
88-
@Generated(hash = 910495430)
88+
@Generated(910495430)
8989
public Customer getCustomer() {
9090
customer = customer__toOne.getTarget(this.customerId);
9191
return customer;
9292
}
9393

9494
/** Set the to-one relation including its ID property. */
95-
@Generated(hash = 1322376583)
95+
@Generated(1322376583)
9696
public void setCustomer(Customer customer) {
9797
customer__toOne.setTarget(customer);
9898
this.customer = customer;

0 commit comments

Comments
 (0)