11from objectbox .model import *
2+ from objectbox .model .properties import IndexType
23import numpy as np
34from datetime import datetime
45
56
67@Entity (id = 1 , uid = 1 )
78class TestEntity :
89 id = Id (id = 1 , uid = 1001 )
9- str = Property (str , id = 2 , uid = 1002 )
10+ str = Property (str , id = 2 , uid = 1002 , index = True )
1011 bool = Property (bool , id = 3 , uid = 1003 )
11- int64 = Property (int , type = PropertyType .long , id = 4 , uid = 1004 )
12- int32 = Property (int , type = PropertyType .int , id = 5 , uid = 1005 )
13- int16 = Property (int , type = PropertyType .short , id = 6 , uid = 1006 )
12+ int64 = Property (int , type = PropertyType .long , id = 4 , uid = 1004 , index = True )
13+ int32 = Property (int , type = PropertyType .int , id = 5 , uid = 1005 , index = True , index_type = IndexType . hash )
14+ int16 = Property (int , type = PropertyType .short , id = 6 , uid = 1006 , index_type = IndexType . hash )
1415 int8 = Property (int , type = PropertyType .byte , id = 7 , uid = 1007 )
1516 float64 = Property (float , type = PropertyType .double , id = 8 , uid = 1008 )
1617 float32 = Property (float , type = PropertyType .float , id = 9 , uid = 1009 )
@@ -30,6 +31,7 @@ class TestEntity:
3031 def __init__ (self , string : str = "" ):
3132 self .str = string
3233
34+
3335@Entity (id = 2 , uid = 2 )
3436class TestEntityDatetime :
3537 id = Id (id = 1 , uid = 2001 )
0 commit comments