GeezerVison is showing github.com — shorter @Generated (no more "hash = ") · liuyuhua-ha/objectbox-java@8bb1df4
File treeExpand file treeCollapse file tree Open diff view settings objectbox-java-api/src/main/java/io/objectbox/annotation tests/objectbox-java-test/src/main/java/io/objectbox
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Generated.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | @Retention(RetentionPolicy.CLASS) | 16 | 16 | @Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) | 17 | 17 | public @interface Generated { | 18 | | - int hash() default -1; | | 18 | + /** A hash to identify the generated code */ | | 19 | + int value() default -1; | 19 | 20 | } |
Collapse file Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/main/java/io/objectbox/index/model/EntityLongIndex.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,11 +19,11 @@ public class EntityLongIndex { | 19 | 19 | Float float4; | 20 | 20 | Float float5; | 21 | 21 |
| 22 | | - @Generated(hash = 37687253) | | 22 | + @Generated(37687253) | 23 | 23 | public EntityLongIndex() { | 24 | 24 | } | 25 | 25 |
| 26 | | - @Generated(hash = 2116856237) | | 26 | + @Generated(2116856237) | 27 | 27 | public EntityLongIndex(long id, long indexedLong, Float float1, Float float2, Float float3, Float float4, Float float5) { | 28 | 28 | this.id = id; | 29 | 29 | this.indexedLong = indexedLong; | |
Collapse file Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/main/java/io/objectbox/relation/Customer.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,14 +29,14 @@ public class Customer { | 29 | 29 |
| 30 | 30 | /** Used to resolve relations */ | 31 | 31 | @Internal | 32 | | - @Generated(hash = 1307364262) | | 32 | + @Generated(1307364262) | 33 | 33 | transient BoxStore __boxStore; | 34 | 34 |
| 35 | | - @Generated(hash = 60841032) | | 35 | + @Generated(60841032) | 36 | 36 | public Customer() { | 37 | 37 | } | 38 | 38 |
| 39 | | - @Generated(hash = 1039711609) | | 39 | + @Generated(1039711609) | 40 | 40 | public Customer(long id, String name) { | 41 | 41 | this.id = id; | 42 | 42 | this.name = name; | @@ -62,7 +62,7 @@ public void setName(String name) { | 62 | 62 | * To-many relationship, resolved on first access (and after reset). | 63 | 63 | * Changes to to-many relations are not persisted, make changes to the target entity. | 64 | 64 | */ | 65 | | - @Generated(hash = 954185799) | | 65 | + @Generated(954185799) | 66 | 66 | public List<Order> getOrders() { | 67 | 67 | if (orders == null) { | 68 | 68 | final BoxStore boxStore = this.__boxStore; | @@ -82,7 +82,7 @@ public List<Order> getOrders() { | 82 | 82 | } | 83 | 83 |
| 84 | 84 | /** Resets a to-many relationship, making the next get call to query for a fresh result. */ | 85 | | - @Generated(hash = 1446109810) | | 85 | + @Generated(1446109810) | 86 | 86 | public synchronized void resetOrders() { | 87 | 87 | orders = null; | 88 | 88 | } | |
Collapse file Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/main/java/io/objectbox/relation/Order.java +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,21 +26,21 @@ public class Order { | 26 | 26 |
| 27 | 27 | /** @Depreacted Used to resolve relations */ | 28 | 28 | @Internal | 29 | | - @Generated(hash = 975972993) | | 29 | + @Generated(975972993) | 30 | 30 | transient BoxStore __boxStore; | 31 | 31 | @Internal | 32 | | - @Generated(hash = 1031210392) | | 32 | + @Generated(1031210392) | 33 | 33 | transient ToOne<Customer> customer__toOne = new ToOne<>(this, Order_.customer); | 34 | 34 |
| 35 | | - @Generated(hash = 1105174599) | | 35 | + @Generated(1105174599) | 36 | 36 | public Order() { | 37 | 37 | } | 38 | 38 |
| 39 | 39 | public Order(Long id) { | 40 | 40 | this.id = id; | 41 | 41 | } | 42 | 42 |
| 43 | | - @Generated(hash = 10986505) | | 43 | + @Generated(10986505) | 44 | 44 | public Order(long id, java.util.Date date, long customerId, String text) { | 45 | 45 | this.id = id; | 46 | 46 | this.date = date; | @@ -85,14 +85,14 @@ public Customer peekCustomer() { | 85 | 85 | } | 86 | 86 |
| 87 | 87 | /** To-one relationship, resolved on first access. */ | 88 | | - @Generated(hash = 910495430) | | 88 | + @Generated(910495430) | 89 | 89 | public Customer getCustomer() { | 90 | 90 | customer = customer__toOne.getTarget(this.customerId); | 91 | 91 | return customer; | 92 | 92 | } | 93 | 93 |
| 94 | 94 | /** Set the to-one relation including its ID property. */ | 95 | | - @Generated(hash = 1322376583) | | 95 | + @Generated(1322376583) | 96 | 96 | public void setCustomer(Customer customer) { | 97 | 97 | customer__toOne.setTarget(customer); | 98 | 98 | this.customer = customer; | |
|