GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Generate converter info into Property Java class (0.9.1-SNAPSHOT) · liuyuhua-ha/objectbox-java@ccec95c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objectbox-java-api/src/main/java/io/objectbox
    • annotation
      • Convert.java
    • converter
      • PropertyConverter.java
  • objectbox-java/src/main/java/io/objectbox
    • Property.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎objectbox-java-api/src/main/java/io/objectbox/annotation/Convert.java‎

Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Convert.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
@Retention(RetentionPolicy.SOURCE)
1414
@Target(ElementType.FIELD)
15-
/** TODO public */ @interface Convert {
15+
public @interface Convert {
1616
/** Converter class */
1717
Class<? extends PropertyConverter> converter();
1818

Collapse file

‎objectbox-java-api/src/main/java/io/objectbox/converter/PropertyConverter.java‎

Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/converter/PropertyConverter.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.objectbox.converter;
1818

1919
/**
20-
* NOT supported yet.
2120
* To use custom types in your entity, implement this to convert db values to entity values and back.
2221
* <p>
2322
* Notes for implementations:
Collapse file

‎objectbox-java/src/main/java/io/objectbox/Property.java‎

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/Property.java
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,33 @@
2929
*/
3030
public class Property {
3131
public final int ordinal;
32+
33+
/** One of the supported types to be mapped to the DB. */
3234
public final Class<?> type;
35+
3336
public final String name;
3437
public final boolean primaryKey;
3538
public final String dbName;
36-
public final Class<PropertyConverter> converterClass;
39+
public final Class<? extends PropertyConverter> converterClass;
40+
41+
/** Type, which is converted to a type supported by the DB. */
42+
public final Class customType;
3743

3844
private int id;
3945

4046
public Property(int ordinal, Class<?> type, String name, boolean primaryKey, String dbName) {
41-
this(ordinal, type, name, primaryKey, dbName, null);
47+
this(ordinal, type, name, primaryKey, dbName, null, null);
4248
}
4349

4450
public Property(int ordinal, Class<?> type, String name, boolean primaryKey, String dbName,
45-
Class<PropertyConverter> converterClass) {
51+
Class<? extends PropertyConverter> converterClass, Class customType) {
4652
this.ordinal = ordinal;
4753
this.type = type;
4854
this.name = name;
4955
this.primaryKey = primaryKey;
5056
this.dbName = dbName;
5157
this.converterClass = converterClass;
58+
this.customType = customType;
5259
}
5360

5461
/** Creates an "equal ('=')" condition for this property. */

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.