|
1 | 1 | /* |
2 | 2 | * ObjectBox Generator - a build time tool for ObjectBox |
3 | | - * Copyright (C) 2018-2024 ObjectBox Ltd. All rights reserved. |
| 3 | + * Copyright (C) 2018-2025 ObjectBox Ltd. All rights reserved. |
4 | 4 | * https://objectbox.io |
5 | 5 | * |
6 | 6 | * This file is part of ObjectBox Generator. |
@@ -55,11 +55,20 @@ static inline OBX_model* create_obx_model() { |
55 | 55 | {{- with $entity.Flags}} |
56 | 56 | obx_model_entity_flags(model, {{CoreEntityFlags .}}); |
57 | 57 | {{- end -}} |
| 58 | + {{- if $entity.ExternalName}} |
| 59 | + obx_model_entity_external_name(model, "{{ $entity.ExternalName }}"); |
| 60 | + {{- end -}} |
58 | 61 | {{range $property := $entity.Properties}} |
59 | 62 | obx_model_property(model, "{{$property.Name}}", OBXPropertyType_{{PropTypeName $property.Type}}, {{$property.Id.GetId}}, {{$property.Id.GetUid}}); |
60 | 63 | {{- with $property.Flags}} |
61 | 64 | obx_model_property_flags(model, {{CorePropFlags .}}); |
62 | 65 | {{- end -}} |
| 66 | + {{- if $property.ExternalName}} |
| 67 | + obx_model_property_external_name(model, "{{ $property.ExternalName }}"); |
| 68 | + {{- end -}} |
| 69 | + {{- if $property.ExternalType}} |
| 70 | + obx_model_property_external_type(model, {{CoreExternalTypes $property.ExternalType}}); |
| 71 | + {{- end -}} |
63 | 72 | {{- if $property.HnswParams -}} |
64 | 73 | {{- if $property.HnswParams.Dimensions}} |
65 | 74 | obx_model_property_index_hnsw_dimensions(model, {{$property.HnswParams.Dimensions}}); |
@@ -93,6 +102,12 @@ static inline OBX_model* create_obx_model() { |
93 | 102 | {{- end}} |
94 | 103 | {{range $relation := $entity.Relations -}} |
95 | 104 | obx_model_relation(model, {{$relation.Id.GetId}}, {{$relation.Id.GetUid}}, {{$relation.Target.Id.GetId}}, {{$relation.Target.Id.GetUid}}); |
| 105 | + {{- if $relation.ExternalName}} |
| 106 | + obx_model_relation_external_name(model, "{{$relation.ExternalName}}"); |
| 107 | + {{- end}} |
| 108 | + {{- if $relation.ExternalType}} |
| 109 | + obx_model_relation_external_type(model, {{CoreExternalTypes $relation.ExternalType}}); |
| 110 | + {{- end}} |
96 | 111 | {{end -}} |
97 | 112 | obx_model_entity_last_property_id(model, {{$entity.LastPropertyId.GetId}}, {{$entity.LastPropertyId.GetUid}}); |
98 | 113 | {{end}} |
|
0 commit comments