orientdb 0.0.19-jruby → 0.0.20-jruby

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.19
1
+ 0.0.20
@@ -5,6 +5,7 @@ module OrientDB
5
5
  DocumentDatabasePool = com.orientechnologies.orient.core.db.document.ODatabaseDocumentPool
6
6
  DocumentDatabasePooled = com.orientechnologies.orient.core.db.document.ODatabaseDocumentTxPooled
7
7
  Document = com.orientechnologies.orient.core.record.impl.ODocument
8
+ IndexType = com.orientechnologies.orient.core.metadata.schema.OClass::INDEX_TYPE
8
9
  OClassImpl = com.orientechnologies.orient.core.metadata.schema.OClassImpl
9
10
  LocalStorage = com.orientechnologies.orient.core.storage.impl.local.OStorageLocal
10
11
  LocalCluster = com.orientechnologies.orient.core.storage.impl.local.OClusterLocal
@@ -20,37 +21,27 @@ module OrientDB
20
21
  SQLSynchQuery = com.orientechnologies.orient.core.sql.query.OSQLSynchQuery
21
22
  User = com.orientechnologies.orient.core.metadata.security.OUser
22
23
 
23
- STORAGE_TYPES = %w{ LOGICAL MEMORY PHYSICAL }.inject({ }) { |h, s| h[s.downcase.to_sym] = ClusterType.const_get s; h }
24
-
25
- FIELD_TYPES = {
26
- :binary => "BINARY",
24
+ INDEX_TYPES = IndexType.constants.inject({ }) { |h, s| h[s.downcase.to_sym] = IndexType.const_get s; h }
25
+ STORAGE_TYPES = ClusterType.constants.inject({ }) { |h, s| h[s.downcase.to_sym] = ClusterType.const_get s; h }
26
+ FIELD_TYPES = SchemaType.constants.inject({ }) { |h, s| h[s.downcase.to_sym] = SchemaType.const_get s; h }
27
+ {
27
28
  :bool => "BOOLEAN",
28
- :boolean => "BOOLEAN",
29
29
  :double => "BYTE",
30
- :date => "DATE",
31
30
  :datetime => "DATE",
32
31
  :decimal => "FLOAT",
33
- :double => "DOUBLE",
34
- :embedded => "EMBEDDED",
35
32
  :embedded_list => "EMBEDDEDLIST",
36
33
  :list => "EMBEDDEDLIST",
37
34
  :embedded_map => "EMBEDDEDMAP",
38
35
  :map => "EMBEDDEDMAP",
39
36
  :embedded_set => "EMBEDDEDSET",
40
37
  :set => "EMBEDDEDSET",
41
- :float => "FLOAT",
42
38
  :int => "INTEGER",
43
- :integer => "INTEGER",
44
- :link => "LINK",
45
39
  :link_list => "LINKLIST",
46
40
  :link_map => "LINKMAP",
47
41
  :link_set => "LINKSET",
48
- :long => "LONG",
49
- :short => "SHORT",
50
- :string => "STRING",
51
- }.inject({ }) do |h, (k, v)|
52
- h[k] = SchemaType.const_get v
53
- h
42
+ }.map do |k,v|
43
+ FIELD_TYPES[k] = SchemaType.const_get(v) unless FIELD_TYPES.key?(k)
54
44
  end
55
45
 
46
+
56
47
  end
@@ -32,10 +32,10 @@ module OrientDB
32
32
  prop.set_max options[:max].to_s unless options[:max].nil?
33
33
  prop.set_mandatory !!options[:mandatory] unless options[:mandatory].nil?
34
34
  prop.set_not_null options[:not_null] unless options[:not_null].nil?
35
- #unless options[:index].nil?
36
- # index_type = options[:index] == true ? INDEX_TYPES[:notunique] : INDEX_TYPES[options[:index]]
37
- # prop.createIndex index_type
38
- #end
35
+ unless options[:index].nil?
36
+ index_type = options[:index] == true ? INDEX_TYPES[:notunique] : INDEX_TYPES[options[:index]]
37
+ prop.createIndex index_type
38
+ end
39
39
 
40
40
  self
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module OrientDB
2
- VERSION = "0.0.19"
2
+ VERSION = File.read File.expand_path(File.join(OrientDB::GEM_PATH, '..', 'VERSION'))
3
3
  end
data/orientdb.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{orientdb}
8
- s.version = "0.0.19"
8
+ s.version = "0.0.20"
9
9
  s.platform = %q{jruby}
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = [%q{Adrian Madrid}]
13
- s.date = %q{2011-12-10}
13
+ s.date = %q{2011-12-12}
14
14
  s.description = %q{Simple JRuby wrapper for the OrientDB.}
15
15
  s.email = [%q{aemadrid@gmail.com}]
16
16
  s.executables = [%q{orientdb_console}]
@@ -34,7 +34,6 @@ Gem::Specification.new do |s|
34
34
  "lib/jars/orientdb-server-1.0rc7.jar",
35
35
  "lib/jars/orientdb-tools-1.0rc7.jar",
36
36
  "lib/jars/persistence-api-1.0.jar",
37
- "lib/old/constants.rb",
38
37
  "lib/orientdb.rb",
39
38
  "lib/orientdb/constants.rb",
40
39
  "lib/orientdb/database.rb",
@@ -18,7 +18,7 @@ describe "OrientDB" do
18
18
  it "should create a valid simple descendant table" do
19
19
  exp_class = "#<OrientDB::OClassImpl:customer super=person tab=FLOAT name=STRING>"
20
20
  exp_props = [
21
- "#<OrientDB::Propery:tab type=decimal indexed=false mandatory=false not_null=false>",
21
+ "#<OrientDB::Propery:tab type=float indexed=false mandatory=false not_null=false>",
22
22
  "#<OrientDB::Propery:name type=string indexed=false mandatory=false not_null=false>"
23
23
  ]
24
24
  @customer_class.to_s.should == exp_class
@@ -26,12 +26,12 @@ describe "OrientDB" do
26
26
  end
27
27
 
28
28
  it "should create a complex table" do
29
- exp_class = "#<OrientDB::OClassImpl:invoice total=FLOAT sold_on=DATE lines=LINKLIST number=INTEGER customer=LINK>"
29
+ exp_class = "#<OrientDB::OClassImpl:invoice total=FLOAT sold_on=DATE lines=LINKLIST number=INTEGER(idx) customer=LINK>"
30
30
  exp_props = [
31
- "#<OrientDB::Propery:total type=decimal indexed=false mandatory=false not_null=false>",
32
- "#<OrientDB::Propery:sold_on type=date indexed=false mandatory=false not_null=false>",
33
- "#<OrientDB::Propery:lines type=link_list indexed=false mandatory=false not_null=false>",
34
- "#<OrientDB::Propery:number type=int indexed=false mandatory=true not_null=false>",
31
+ "#<OrientDB::Propery:total type=float indexed=false mandatory=false not_null=false>",
32
+ "#<OrientDB::Propery:sold_on type=date indexed=false mandatory=false not_null=false>",
33
+ "#<OrientDB::Propery:lines type=linklist indexed=false mandatory=false not_null=false>",
34
+ "#<OrientDB::Propery:number type=integer indexed=true mandatory=true not_null=false>",
35
35
  "#<OrientDB::Propery:customer type=link indexed=false mandatory=false not_null=true>"
36
36
  ]
37
37
  @invoice_class.to_s.should == exp_class
data/spec/spec_helper.rb CHANGED
@@ -53,15 +53,8 @@ unless defined?(SPEC_HELPER_LOADED)
53
53
  :number => {:type => :int, :mandatory => true, :index => true},
54
54
  :customer => {:type => @customer_class, :not_null => true},
55
55
  :sold_on => :date,
56
- :total => {:type => :float}, # , :min => java.lang.Float.new('0.01'), :max => java.lang.Float.new('1000.0')
56
+ :total => {:type => :float},
57
57
  :lines => [:link_list, @line_class]
58
-
59
- #@person_class = DB.recreate_class :person
60
- #@customer_class = DB.recreate_class :customer
61
- #@employee_class = DB.recreate_class :employee
62
- #@product_class = DB.recreate_class :product
63
- #@line_class = DB.recreate_class :invoice_line
64
- #@invoice_class = DB.recreate_class :invoice
65
58
  end
66
59
  end
67
60
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: orientdb
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.19
5
+ version: 0.0.20
6
6
  platform: jruby
7
7
  authors:
8
8
  - Adrian Madrid
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-10 00:00:00 Z
13
+ date: 2011-12-12 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: awesome_print
@@ -60,7 +60,6 @@ files:
60
60
  - lib/jars/orientdb-server-1.0rc7.jar
61
61
  - lib/jars/orientdb-tools-1.0rc7.jar
62
62
  - lib/jars/persistence-api-1.0.jar
63
- - lib/old/constants.rb
64
63
  - lib/orientdb.rb
65
64
  - lib/orientdb/constants.rb
66
65
  - lib/orientdb/database.rb
data/lib/old/constants.rb DELETED
@@ -1,7 +0,0 @@
1
- module OrientDB
2
-
3
- #IndexType = com.orientechnologies.orient.core.metadata.schema::OProperty::INDEX_TYPE
4
-
5
- #INDEX_TYPES = %w{ FULLTEXT NOTUNIQUE UNIQUE }.inject({}) { |h, s| h[s.downcase.to_sym] = IndexType.const_get s; h }
6
-
7
- end