Skip to content

Vita_HiLi

[email protected] edited this page Jan 22, 2020 · 5 revisions

VITA ORM Highlights

Full-featured ORM - c# entities are automatically mapped to database tables. CRUD SQLs are generated automatically from mappings. Entities are tracked inside the data session - whenever modification is made to an entity, it is added to the list of entities to be saved in the next SaveChanges call.

Support for all popular database servers - VITA supports MS SQL Server, MySql, PostgreSql, Oracle, SQLite.

Automatic database schema management - code-first scenario is fully supported. Database objects (schemas, tables, views, keys, indexes) are created from c# entities, and maintained/changes whenever c# entities change at app start. Alternatively, you can generate diff scripts for updating the database. Using special entity attributes you can create and maintain the detailed schema in the database - tables/columns, specific naming patterns, column types, keys, indexes, foreign keys.

Importantly, the schema updates are based on diffs (entities vs tables), ready to restart in any intermediate state, and not on explicitly coded migrations - which may leave database in broken state in the middle after occasional failure.

DB-first scenario is fully supported as well - the entity model (c#) can be generated from existing database.

One-to-many and many-to-many relations - both types of relations are supported through list-type properties on entities providing direct access to associated lists.

Full support for identity columns or auto-generated GUIDs - VITA supports GUID or identity primary keys. Generated identity values are returned from the database and automatically put into the entity properties.

Full LINQ support - VITA implements full LINQ engine that translates strongly-typed LINQ expressions over entities into SQL queries. Efficient query cache allows re-use of previously translated SQL statements.

Include-with-query-result facility is supported. Provides a solution for so-called N+1 queries problem; allows delivery of related/child records with the main query results.

LINQ-based Multi-Row Update/Insert/Delete commands - LINQ engine allows you to create multi-row database commands (update/insert/delete many) based on LINQ expressions.

Transaction and locking/isolation support - all database updates with more than one SQL command are executed in transaction. VITA implements an advanced document-level locking mechanism providing proper isolation when accessing compound documents.

Batched updates and multi-row Inserts - Multiple record updates (inserts, deletes) are batched into a single batch statement enclosed in begin/commit trans, and executed in a single roundtrip to database. Additionally, multiple row inserts into the same table are merged into multi-row INSERT SQL statement. Note: identity columns are supported in batch mode: generated values are returned back to the orininating entities.

Automatic update ordering - VITA data engine automatically orders update/insert/delete commands to respect referential integrity (foreign keys)

Maintaining user identity - VITA allows you to maintain and track current user identity throughout the data operations.

Integration with ASP.NET-Core - the nuget package with a custom middleware is provided.

Powerful logging and diagnostics infrastructure is built-in. You can easily send detailed logs with executed SQLs to a file or database table.

Smart entity tracking - Loaded but not modified entities are tracked inside the session using weak references, which is dropped/removed when entity is garbage-collected. So no overflow when reading 100K entities in a loop (unlike Hibernate)

Multi-tenant applications. Support for connecting to multiple databases from a single app, one DB per tenant, and automatically directing data operations to the proper tenant database.

Clone this wiki locally