Skip to content

Vault Coder v1.12 - Inheritance support & other new features

Choose a tag to compare

@Mikkomario Mikkomario released this 04 Oct 20:32
· 58 commits to master since this release

Summary

A major upgrade introducing multiple new features:

  1. Support for generic traits and inheritance
  2. Automated code refactoring
  3. Commands for listing project information

This update also changes syntax for combined models and uses different database model naming logic.
Also, IntSets are now automatically supported in the generated with functions and id-based accessing.

Breaking changes

  • Database model classes are now named "XDbModel" instead of "XModel"
  • In "many" root access objects, an id-targeting subclass is no longer generated,
    except for classes that have descriptions. Instead, the access point either extends ViewManyByIntIds,
    if it uses Int ids, or defines a simple .apply(Iterable[Long]) implementation (in case it uses Long ids)
    • Please note, however, that the nested instances and the apply implementations from previous versions
      are not removed automatically
  • Combined models are now written as traits with concrete implementations included as nested objects

Bugfixes

  • When specifying multiple directories, the separator is now : instead of &, since & had issues on Linux
  • Fixed an issue where classes with Long ids
    would be targeted with Int ids in their "many" root access -variants
  • When using filtering, parent classes are now included also

New features

  • Added support for inheritance
    • Generic trait models (i.e. those marked with "generic": true) can now be extended by adding
      "extends": "<parent class name>" to the model declaration
      • See README for more details
  • Added 3 new commands / alternative modes:
    • list: Lists all projects that have been registered
    • show <project>: Shows paths that are relevant to a project
    • upgrade <...>: Performs automated refactoring, facilitating the transitioning between Vault versions
      • At this time, only upgrade to Vault v1.20 (changes in FilteringView) is supported
  • Added the generation of common combination traits, when appropriate
    • This feature may be managed manually with the new has_many_combos -property in class models
  • Added Version as a new data type
  • Added an option skipping file-generation for specific classes and instead referencing them from another project
    • The main use-case for this is when utilizing generic classes from other projects or modules
    • See README for more details
  • The stored class version may now be prefixed by specifying a "prefix" property
    • This can help avoid naming conflicts when you want to use the same name elsewhere, also

Other changes

  • If the "with" method is specified in class documentation,
    "in" method will be automatically generated by pluralizing the specified "with" method
  • This version utilizes and supports Vault v1.20
  • Generated in(...) methods in access points, if they accept Int values, now wrap those values in IntSets
  • Generated access trait companion objects now extend ViewFactory
  • Modified access trait companion object syntax