All Projects → relativitydev → Gravity

relativitydev / Gravity

Licence: other
ORM Framework for Relativity Custom Development

Programming Languages

csharp
926 projects

Labels

Projects that are alternatives of or similar to Gravity

Nano Sql
Universal database layer for the client, server & mobile devices. It's like Lego for databases.
Stars: ✭ 717 (+4117.65%)
Mutual labels:  orm
Doctrinebehaviors
Doctrine2 behavior traits
Stars: ✭ 782 (+4500%)
Mutual labels:  orm
Orm
PHP DataMapper, ORM
Stars: ✭ 827 (+4764.71%)
Mutual labels:  orm
Opulence
A simple, secure, and scalable PHP application framework
Stars: ✭ 723 (+4152.94%)
Mutual labels:  orm
Xorm
Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
Stars: ✭ 6,464 (+37923.53%)
Mutual labels:  orm
One
一个极简高性能php框架,支持[swoole | php-fpm ]环境
Stars: ✭ 789 (+4541.18%)
Mutual labels:  orm
Rapid.js
An ORM-like Interface and a Router For Your API Requests
Stars: ✭ 700 (+4017.65%)
Mutual labels:  orm
Entityframework.docs
Documentation for Entity Framework Core and Entity Framework 6
Stars: ✭ 888 (+5123.53%)
Mutual labels:  orm
Latke
🌀 一款以 JSON 为主的 Java Web 框架。
Stars: ✭ 781 (+4494.12%)
Mutual labels:  orm
Diesel
A safe, extensible ORM and Query Builder for Rust
Stars: ✭ 7,702 (+45205.88%)
Mutual labels:  orm
Easy Php
A Faster Lightweight Full-Stack PHP Framework 🚀
Stars: ✭ 754 (+4335.29%)
Mutual labels:  orm
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+4458.82%)
Mutual labels:  orm
Gonet
go分布式服务器,基于内存mmo
Stars: ✭ 804 (+4629.41%)
Mutual labels:  orm
Skinny Framework
🚝 "Scala on Rails" - A full-stack web app framework for rapid development in Scala
Stars: ✭ 719 (+4129.41%)
Mutual labels:  orm
Advpl Orm
Biblioteca ORM (Object Relational Mapping) desenvolvida inteiramente em ADVPL para o ERP Protheus
Stars: ✭ 6 (-64.71%)
Mutual labels:  orm
Orm
A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen
Stars: ✭ 712 (+4088.24%)
Mutual labels:  orm
Droidparts
Stars: ✭ 785 (+4517.65%)
Mutual labels:  orm
Delphi Orm
Delphi ORM
Stars: ✭ 16 (-5.88%)
Mutual labels:  orm
Goloquent
This repo no longer under maintenance, please go to https://github.com/si3nloong/sqlike
Stars: ✭ 16 (-5.88%)
Mutual labels:  orm
Records
SQL for Humans™
Stars: ✭ 6,761 (+39670.59%)
Mutual labels:  orm

Gravity

Open Source Community: Gravity is an ORM framework for Relativity custom development. Using Gravity will greatly decrease the amount of time it takes to pick up Relativity development and allow you to write code that interacts with Relativity with commonly used C# syntax.

While this project is hosted on the RelativityDev account, support is only available through the Relativity developer community. You are welcome to use the code and solution as you see fit within the confines of the license it is released under. However, if you are looking for support or modifications to the solution, we suggest reaching out to a Relativity Development Partner.

Gravity was originally created by TSD Services. Through their generosity and leadership, they have released the project as open source. It is an active project and has contributions from other Relativity Development Partners. Anyone who has a need is invited to use and contribute to the project. If you are interested in contributing, check out the open issues and Wiki pages.

We would like to recognize the following Relativity Development Partners who have made significant contributions to the Gravity project:

TSD Services            

This is also available as a nuget package.

Target Frameworks

  • .NET 4.5.1, .NET 4.6.2

Dependencies

This project requires references to Relativity's Relativity® SDK dlls, which are referenced via Nuget packages. As such, DLL versions 9.4.224.2 and up are supported.

Sample / Test Suite

Information about the demo application and accompanying integration tests is available on a separate page.

Usage Guide

Before using the CRUD/Q methods in Gravity you will have to create a model and decorate it with the appropriate attributes:

  • RelativityObject - Specifies the type Guid of the RDO you are targeting.
  • RelativityObjectField - Specifies the type Guid and the "RdoFieldType" of the RDO field you are targeting.
  • RelativityObjectChildrenList - Used to decorate a List of child RDOs as a object List.
  • RelativityObjectFieldParentArtifactId - If the RDO is a child object, used to specify that the RDO field contains the ParentArtifactID

The following example demonstrates a RDO represented as a Model:

[Serializable]
[RelativityObject("0B5C62E0-2AFA-4408-B7FF-789351C9BEDC")]
public class DemoPurchaseOrder : BaseDto
{
	[RelativityObjectField("E1FA93B9-C2DB-442A-9978-84EEB6B61A3F", RdoFieldType.FixedLengthText, 255)]
	public override string Name { get; set; }

	[RelativityObjectField("37159592-B5B6-4405-AF74-10B5728890B4", RdoFieldType.WholeNumber)]
	public int OrderNumber { get; set; }

	[RelativityObjectField("37159592-B5B6-4405-AF74-10B5728890B4", RdoFieldType.FixedLengthText, 100)]
	public string CustomerName { get; set; }

	[RelativityObjectField("3BDC0971-A87C-414E-9A37-FC477279BBAD", RdoFieldType.FixedLengthText, 100)]
	public string CustomerEmail { get; set; }

	[RelativityObjectField("D0770889-8A4D-436A-9647-33419B96E37E"), RdoFieldType.MultipleObject)]
	public IList<Items> Items { get; set; }

	[RelativityObjectField("D0770889-8A4D-436A-9647-33419B96E37E"), RdoFieldType.SingleObject)]
	public Address Address { get; set; }

	[RelativityObjectField("4501A308-5E68-4314-AEDC-4DEB527F12A8", RdoFieldType.Decimal)]
	public decimal Total { get; set; }

	[RelativityObjectField("CEDB347B-679D-44ED-93D3-0B3027C7E6F5", RdoFieldType.SingleChoice)]
	public OrderType OrderType { get; set; }

	[RelativityObjectChildrenList]
	public IList<RelatedPurchase> RelatedPurchases { get; set; }
}
  • Note:
    • For property of type User use kCura.Relativity.Client.DTOs.User [limited support]
    • For property of type FileField use Gravity.Base.FileDto
      • If the file is only going to be read from the server, or you can keep the files entirely in memory, use the Gravity.Base.ByteArrayFileDto subclass. This is the class returned by any Get requests.
      • If you want to use files stored on disk AND don't need to read the files from the server, you can use the Gravity.Base.DiskFileDto subclass.
      • Otherwise, use the base class and cast as necessary.

For Choice field you must create a enum and decorate it with the appropriate attributes:

  • RelativityObject - Specifies the choice Guid.

The following example demonstrates a choice field represented as an Enum:

public enum OrderType
{
	[RelativityObject("4F04381D-F3E3-4DEE-8EF9-11F27047D9B4")]
	TypeOne = 1,

	[RelativityObject("8453BF3E-D95B-4BC5-BD68-3CF4277DD731")]
	TypeTwo = 2
}

To use Gravity for RSAPI operations, you must instantiate an RsapiDao object using the RsapiDao constructor, with IHelper and workspaceId as parameters.

Supported IGravityDao methods:

  • Get<T>(int artifactId, ObjectFieldsDepthLevel depthLevel) - Get DTO by Artifact ID.
  • Get<T>(IList<int> artifactIDs, ObjectFieldsDepthLevel depthLevel) - Get DTOs by Artifact IDs.
  • Delete<T>(int objectToDeleteId)- Delete object recursively (includes child objects) by Artifact ID.
  • Insert<T>(T theObjectToInsert, ObjectFieldsDepthLevel depthLevel) - Insert Relativity object from RDO, updating the RDO with its new ArtifactID.
  • Insert<T>(IList<T> theObjectsToInsert, ObjectFieldsDepthLevel depthLevel) - Insert Relativity objects from RDOs, updating the RDOs with their new ArtifactIDs.
  • Update<T>(BaseDto theObjectToUpdate, ObjectFieldsDepthLevel depthLevel) - Update Relativity object from RDO, inserting any non-existing children.
  • Update<T>(IList<T> theObjectsToUpdate, ObjectFieldsDepthLevel depthLevel) - Update Relativity objects from RDOs, inserting any non-existing children.
  • UpdateField<T>(int rdoID, Guid fieldGuid, object value) - Update field value by GUID and RDO Artifact ID [limited support]

Additional methods supported by RsapiDao:

  • List<T> Query<T>(Condition queryCondition = null, ObjectFieldsDepthLevel depthLevel = ObjectFieldsDepthLevel.FirstLevelOnly) - Get all DTOs of type matching an optional RSAPI query condition

Where available, the depthLevel parameter controls whether (and how deeply) to recurse into object fields and child object lists. The recursion options are OnlyParentObject, FirstLevelOnly, and FullyRecursive.

Example

The following example demonstrates a object "Get" used in Event handler. First we instantiate RsapiDao and then we use the Gravity RSAPI Dao Get method to get the object (ObjectFieldsDepthLevel.OnlyParentObject means that we want just the object - no child object fields, multiple object fields or single object fields are populated recursively):

public override Response Execute()
{
	Response returnResponse = new Response() { Message = string.Empty, Success = true };

	RsapiDao gravityRsapiDao = new RsapiDao(this.Helper, this.Helper.GetActiveCaseID());

		DemoPurchaseOrder demoOrder =  gravityRsapiDao.Get<DemoPurchaseOrder>(1047088,
	  ObjectFieldsDepthLevel.OnlyParentObject);

		return returnResponse;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].