Method: ActiveOrient::API#create_index

Defined in:
lib/jdbc.rb,
lib/java-api.rb

#create_index(o_class, name:, on: :automatic, type: :unique) ⇒ Object



175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/jdbc.rb', line 175

def create_index o_class, name:, on: :automatic, type: :unique
  logger.progname = 'JavaApi#CreateIndex'
  begin
	c = @db.get_class( classname( o_class ))
	index = if on == :automatic
nil   # not implemented
		elsif on.is_a? Array
c.createIndex name.to_s, INDEX_TYPES[type],  *on
		else
c.createIndex name.to_s, INDEX_TYPES[type],  on
		end
  end
end