-
Notifications
You must be signed in to change notification settings - Fork 5
Initialisation
topofocus edited this page Mar 29, 2019
·
19 revisions
ActivdeOrient requires a running OrientDB-Server-instance
ORD = ActiveOrient::Init.connect database: <temp>,
user: <root>,
password: <root>,
server: <localhost>,
port: <2480>,
logger: <nil>
connects to the server, opens the database and gathers informations about server and database.
Base-Classes for Edges and Vertexes, E and V are allocated.
The directive ActiveOrient::Model.keep_models_without_file
controls the preallocation process.
- If set to
false
, only database-classes with corresponding model-files are preallocated and assigned to theirActiveOrient::Model
class. - If set to
true
, any database class present is allocated to aActiveOrient::Model
class.
ActiveOrient::Model
-Methods are stored in (root)/lib/model
by default.
The location is overwritten by
ActiveOrient::Model.model_dir = project_root + '/model'
A typical setup using the ActiveOrient Gem:
#(after ActiveOrient::Init.connect)
project_root = File.expand_path('../..', __FILE__)
ActiveOrient::Model.model_dir = project_root + '/model'
ActiveOrient::OrientDB.new preallocate: true
Then model files are required from the model
-directory of the application rather then the gem-root-dir.
ORD = ActiveOrient::Init.connect
project_root = File.expand_path('../..', __FILE__)
ActiveOrient::Model.model_dir = project_root + '/model'
ActiveOrient::Model.keep_models_without_file = false
# allocate classes from /model directory
ActiveOrient::OrientDB.new preallocate: true
module HC; end
ActiveOrient::Init.define_namespace { HC }
# allocate classes from /model/hc directory
ActiveOrient::OrientDB.new preallocate: true
# allocate any other classes and use methods defined in /model/tg
ActiveOrient::Init.define_namespace { TG }
ActiveOrient::Model.keep_models_without_file = true
ActiveOrient::OrientDB.new preallocate: true
Overview
Data Management
- Joining Tables, embedded Lists
- Links and Link Lists
- Relations
- Bidirectional Connections
- Working with Hashes
Public API
- Database
- Model CRUD
Misc