Skip to content

Commit 1c31f9f

Browse files
michel-guillonjreynard-code
authored andcommitted
Add Long and Boolean types to toPropertyType method
1 parent 4f3f25a commit 1c31f9f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

dataset/src/main/kotlin/com/cosmotech/dataset/bulk/PropertyType.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fun Any?.toPropertyType(): PropertyType {
2121
when (this) {
2222
is Int -> type = PropertyType.BI_LONG
2323
is Double -> type = PropertyType.BI_DOUBLE
24+
is Long -> type = PropertyType.BI_LONG
25+
is Boolean -> type = PropertyType.BI_BOOL
2426
is String -> {
2527
this.toIntOrNull()?.let {
2628
return PropertyType.BI_LONG

dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@ class DatasetServiceImpl(
279279
record?.values()?.forEach { element ->
280280
when (element) {
281281
is Node -> {
282-
val properties =
283-
element.entityPropertyNames.associateWith { it -> element.getProperty(it).value }
284-
queryBuffer.addNode(element.getLabel(0), element.id.toString(), properties)
282+
val csmGraphEntity = element.toCsmGraphEntity(CsmGraphEntityType.NODE)
283+
queryBuffer.addNode(csmGraphEntity.label, csmGraphEntity.id, csmGraphEntity.properties)
285284
}
286285
is Edge -> {
287286
val csmGraphEntity = element.toCsmGraphEntity(CsmGraphEntityType.RELATION)

0 commit comments

Comments
 (0)