Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support primitive java types #299

Merged

Conversation

luxbe
Copy link
Contributor

@luxbe luxbe commented Dec 16, 2024

This fixes #297 by adding support for primitive Java types like int, short, boolean and more.

  • Currently, char is unsupported, because XSD does not include a char datatype. We could however probably implement it by mapping it to XSD.STRING
  • If the database is missing the value for a primitive type, an exception is thrown, because primitive types can not be set to null. I think this behavior is valid, because this state is only reachable if the database is mutated directly, but I would love to add a test for this - where would be a good place to do so?

@luxbe luxbe force-pushed the feature/297-primitive-java-attributes branch from 89b0f05 to 4a30c29 Compare December 16, 2024 15:57
…e method

- converts Wrapper classes (e.g. Integer.class) to their corresponding primitive counterparts (e.g. int.class)
…elds

- remove MetamodelInitializationException thrown in ClassFieldMetamodelProcessor
- check if Wrapper type can be converted to primitive type in DataPropertyFieldStrategy
@luxbe luxbe force-pushed the feature/297-primitive-java-attributes branch from 6fb4725 to c509e48 Compare December 17, 2024 13:20
Copy link
Contributor

@ledsoft ledsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of small suggestions.

Copy link
Contributor

@ledsoft ledsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ledsoft ledsoft linked an issue Dec 17, 2024 that may be closed by this pull request
@ledsoft ledsoft merged commit d5cf6fe into kbss-cvut:development Dec 17, 2024
1 check passed
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.

Support primitive Java types as attribute types
2 participants