Skip to content

Support default, primitive Kotlin attributes. #2276

@pelletier197

Description

@pelletier197

Default values for fields are not supported for constructor of node entities when querying the database with a custom query.

CREATE (person:Person { id: "first", firstName: "firstName"})
CREATE (person:Person { id: "second"})

with the following data class

@Node("Person")
data class Person(
  val id: String, 
  val firstName: String = "Unknown"
)

and the following repository

interface PersonRepository : Neo4jRepository<Person, String>

calling personRepository.findAll() results in

Could not convert NULL into String; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [null] to type [String] for value 'null';

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions