Skip to content

Vault Coder v1.11 - Style updates, new code generation and support for larger projects

Choose a tag to compare

@Mikkomario Mikkomario released this 29 Jul 03:26
· 83 commits to master since this release

Summary

This update introduces both a number of styling updates (breaking) and multiple new features.
Most importantly, feature-wise, projects may now be split into multiple submodules and even package-specific
json files. This helps in keeping track of classes in larger projects.

Other important new features include:

  • Generation of various withX(...) access / filter functions
  • Generation of factory traits with various withX(...) functions
  • New data types
  • Property mutabilities, which affect whether setters will be generated to the access points
  • Automated backups of merged files

Breaking changes

  • Code-generation now matches Vault v1.19
  • Factory objects are now named "...DbFactory" instead of "...Factory"
  • Database model factories no longer contain separate -attName and -column properties,
    but individual properties that implicitly (or explicitly) convert to both
  • Database model factories no longer contain a factory property
  • Database models now extend Storable instead of StorableWithFactory
  • Database models are now written into database.storable package instead of database.model package
  • The input file no longer supports classes defined as a single class property
  • A package property no longer supports an object as a value
  • Removed support for generating multiple projects at once
    • It is not certain, however, whether this feature was ever possible to utilize anyway
    • This is replaced with the new multimodal projects -feature
  • Generated UniqueXAccessLike traits now extend FilterableView
  • The child-property in multi-linked combined models is now Seq instead of Vector
  • The .values property in enumerations with exactly two values is now of type Pair instead of Vector
  • Setters are no longer always generated in access points (see new feature of mutability)

Bugfixes

  • Enumerations are no longer wrapped as ids in the DB models, but as enum values directly
  • Fixed wrong scaladocs in database model withX method generations

New features

  • Added support for referencing other files as package content
  • Added support for multimodal projects (see README for details)
  • Added support for Angle, Path and LinearVelocity data types
  • Added writing of factory traits, which facilitate with-method creation
  • Support for autogenerated withX(...) filter/access methods (see README for details)
  • Added customization of property mutability (see README for details)
    • This currently affects only access point setter generation
  • Backups are now taken before merging files
  • Sub-packaging may now be omitted for individual classes by specifying a sub-package of "-"

Other changes

  • All access point companion objects now contain a public .apply(Condition) method
    • This method is now utilized in the generated filter functions, also, making the code slightly cleaner
  • Id-based many access -targeting now accepts Iterable instead of just Set
    (it is left up to the caller to make sure the values are unique)
  • Unconditional single model access points now generate .distinct(Condition) instead of .filterDistinct(Condition)
  • Now generates scaladoc for the generated .id and .ids properties in access points
  • Generated scala file output is now placed under a subdirectory called src