Class: Dynamicloud::API::Criteria::Conditions
- Inherits:
-
Object
- Object
- Dynamicloud::API::Criteria::Conditions
- Defined in:
- lib/dynamic_criteria.rb
Overview
This is a builder to create conditions: AND, OR, LIKE, NOT LIKE, IN, NOT IN, EQUALS, GREATER THAN, GREATER EQUALS THAN LESSER THAN, LESSER EQUALS THAN.
Class Method Summary collapse
-
.and(left, right) ⇒ Object
It will build an and condition using two parts (Left and Right).
-
.between(field, left, right) ⇒ Object
Builds a between condition.
-
.equals(left, right) ⇒ Object
It will build an equals condition.
-
.exists(model_id = nil, aliass = nil) ⇒ Object
Creates a new instance of ExistsCondition.
-
.greater_equals(left, right) ⇒ Object
It will build a greater equals condition.
-
.greater_than(left, right) ⇒ Object
It will build a greater condition.
-
.in(left, values) ⇒ Object
It will an in condition using an array of values.
-
.inner_join(model_id, aliass, condition) ⇒ Object
Builds a inner join clause.
-
.left_join(model_id, aliass, condition) ⇒ Object
Builds a left join clause.
-
.left_outer_join(model_id, aliass, condition) ⇒ Object
Builds a left outer join clause.
-
.lesser_equals(left, right) ⇒ Object
It will build a lesser equals condition.
-
.lesser_than(left, right) ⇒ Object
It will build a lesser condition.
-
.like(left, like) ⇒ Object
It will build a like condition.
-
.not_equals(left, right) ⇒ Object
It will build a not equals condition.
-
.not_exists(model_id = nil, aliass = nil) ⇒ Object
Creates a new instance of ExistsCondition.
-
.not_in(left, values) ⇒ Object
It will an in condition using an array of values.
-
.not_like(left, like) ⇒ Object
It will build a not like condition.
-
.or(left, right) ⇒ Object
It will build an or condition using two parts (Left and Right).
-
.right_join(model_id, aliass, condition) ⇒ Object
Builds a right join clause.
-
.right_outer_join(model_id, aliass, condition) ⇒ Object
Builds a right outer join clause.
Class Method Details
.and(left, right) ⇒ Object
It will build an and condition using two parts (Left and Right)
458 459 460 |
# File 'lib/dynamic_criteria.rb', line 458 def self.and(left, right) ANDCondition.new(left, right); end |
.between(field, left, right) ⇒ Object
Builds a between condition
477 478 479 |
# File 'lib/dynamic_criteria.rb', line 477 def self.between(field, left, right) return BetweenCondition.new(field, left, right) end |
.equals(left, right) ⇒ Object
It will build an equals condition.
535 536 537 |
# File 'lib/dynamic_criteria.rb', line 535 def self.equals(left, right) inner_equals(left, right, Dynamicloud::API::Criteria::Condition::WITHOUT) end |
.exists(model_id = nil, aliass = nil) ⇒ Object
Creates a new instance of ExistsCondition
486 487 488 |
# File 'lib/dynamic_criteria.rb', line 486 def self.exists(model_id = nil, aliass = nil) ExistsCondition.new(model_id, aliass, false) end |
.greater_equals(left, right) ⇒ Object
It will build a greater equals condition.
552 553 554 |
# File 'lib/dynamic_criteria.rb', line 552 def self.greater_equals(left, right) inner_equals(left, right, '>') end |
.greater_than(left, right) ⇒ Object
It will build a greater condition.
561 562 563 |
# File 'lib/dynamic_criteria.rb', line 561 def self.greater_than(left, right) GreaterLesser.new(left, right, '>') end |
.in(left, values) ⇒ Object
It will an in condition using an array of values.
503 504 505 |
# File 'lib/dynamic_criteria.rb', line 503 def self.in(left, values) inner_in_condition(left, values, false) end |
.inner_join(model_id, aliass, condition) ⇒ Object
Builds a inner join clause.
628 629 630 |
# File 'lib/dynamic_criteria.rb', line 628 def self.inner_join(model_id, aliass, condition) return JoinClause.new(JoinType::INNER, model_id, aliass, condition); end |
.left_join(model_id, aliass, condition) ⇒ Object
Builds a left join clause.
588 589 590 |
# File 'lib/dynamic_criteria.rb', line 588 def self.left_join(model_id, aliass, condition) return JoinClause.new(JoinType::LEFT, model_id, aliass, condition); end |
.left_outer_join(model_id, aliass, condition) ⇒ Object
Builds a left outer join clause.
598 599 600 |
# File 'lib/dynamic_criteria.rb', line 598 def self.left_outer_join(model_id, aliass, condition) return JoinClause.new(JoinType::LEFT_OUTER, model_id, aliass, condition); end |
.lesser_equals(left, right) ⇒ Object
It will build a lesser equals condition.
578 579 580 |
# File 'lib/dynamic_criteria.rb', line 578 def self.lesser_equals(left, right) inner_equals(left, right, '<') end |
.lesser_than(left, right) ⇒ Object
It will build a lesser condition.
570 571 572 |
# File 'lib/dynamic_criteria.rb', line 570 def self.lesser_than(left, right) GreaterLesser.new(left, right, '<') end |
.like(left, like) ⇒ Object
It will build a like condition.
519 520 521 |
# File 'lib/dynamic_criteria.rb', line 519 def self.like(left, like) LikeCondition.new(left, like, false) end |
.not_equals(left, right) ⇒ Object
It will build a not equals condition.
543 544 545 |
# File 'lib/dynamic_criteria.rb', line 543 def self.not_equals(left, right) inner_not_equals(left, right) end |
.not_exists(model_id = nil, aliass = nil) ⇒ Object
Creates a new instance of ExistsCondition
495 496 497 |
# File 'lib/dynamic_criteria.rb', line 495 def self.not_exists(model_id = nil, aliass = nil) ExistsCondition.new(model_id, aliass, true) end |
.not_in(left, values) ⇒ Object
It will an in condition using an array of values.
511 512 513 |
# File 'lib/dynamic_criteria.rb', line 511 def self.not_in(left, values) inner_in_condition(left, values, true) end |
.not_like(left, like) ⇒ Object
It will build a not like condition.
527 528 529 |
# File 'lib/dynamic_criteria.rb', line 527 def self.not_like(left, like) LikeCondition.new(left, like, true) end |
.or(left, right) ⇒ Object
It will build an or condition using two parts (Left and Right)
467 468 469 |
# File 'lib/dynamic_criteria.rb', line 467 def self.or(left, right) ORCondition.new(left, right) end |
.right_join(model_id, aliass, condition) ⇒ Object
Builds a right join clause.
608 609 610 |
# File 'lib/dynamic_criteria.rb', line 608 def self.right_join(model_id, aliass, condition) return JoinClause.new(JoinType::RIGHT, model_id, aliass, condition); end |
.right_outer_join(model_id, aliass, condition) ⇒ Object
Builds a right outer join clause.
618 619 620 |
# File 'lib/dynamic_criteria.rb', line 618 def self.right_outer_join(model_id, aliass, condition) return JoinClause.new(JoinType::RIGHT_OUTER, model_id, aliass, condition); end |