Skip to content

Have @ExoEntity imply @Serializable, integrate with IDE database tools - #94

Draft
Zrp200 wants to merge 4 commits into
ExoQuery:mainfrom
Zrp200:meta-annotations
Draft

Have @ExoEntity imply @Serializable, integrate with IDE database tools#94
Zrp200 wants to merge 4 commits into
ExoQuery:mainfrom
Zrp200:meta-annotations

Conversation

@Zrp200

@Zrp200 Zrp200 commented Jan 16, 2026

Copy link
Copy Markdown

This is actually several suggestions regarding the same annotation (ExoEntity). I've split them into separate commits to reflect the individual suggestions.

I don't mind if you implement this yourself without merging or implement only a part of these, but I figured I'd at least offer code.

IDE database integration for ExoEntity

59b036e adds a @Language annotation to ExoEntity#value annotation to enable IDE integration with the annotation.
This should simulate actual query usage of the given name. I noticed that names are always quoted in queries, so this is always quoted as well.

This enables:

  • IDE database verification
  • automatic refactoring by IDE database tools
  • validity checking
Image Here I linked a H2 database to PersonWithId.

ExoEntity implies @Serializable

In every single example usage of ExoEntity, as well as every example I find in the codebase, this annotation is always accompanied by @Serializable.

Add @MetaSerializable to ExoEntity

a1ee287 lets you omit @Serializable entirely when using that annotation.

So instead of

@Serializable
@ExoEntity("address")
data class AddressWithId(val ownerId: PersonId, val street: String, val zip: Int)

You can write simply

@ExoEntity("address")
data class AddressWithId(val ownerId: PersonId, val street: String, val zip: Int)

Extension: Make @ExoEntity a true alias of Serializable

As an extension of the previous, d267581 makes @Serializable completely optional in all cases:

So instead of

@Serializable
data class Address(val ownerId: Int, val street: String, val zip: Int)

You can write

@ExoEntity
data class Address(val ownerId: Int, val street: String, val zip: Int)

Extension: Add a docstring to @ExoEntity

134ebdb just adds a docstring to @ExoEntity, not sure what else to say.

@Zrp200
Zrp200 marked this pull request as draft January 20, 2026 02:18
@Zrp200
Zrp200 marked this pull request as ready for review January 20, 2026 02:20
@Zrp200
Zrp200 marked this pull request as draft January 26, 2026 00:57
This allows for direct IDE integration with the serialized data class
This removes the need to specify @serializable every single time it's used

Also adjusted engine to detect it as an implicit serializer
* Updated associated usages to remove @serializable
@Zrp200

Zrp200 commented Jan 26, 2026

Copy link
Copy Markdown
Author

I'd failed to adjust the engine to detect the annotation as implying that there is a serializer previously

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant