InstanceMethods
valuesIn(columnName, values) -> Query
columunNameで指定されたカラムに、valuesで指定された値が含まれるデータを全て取得します。
valuesのOR検索です。
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | columnName | String | 検索条件の対象となるカラム名を指定します。 | 
    
      | values | Array | OR検索条件の値の配列を指定します。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .valuesIn('columnA', ['1234','abcd'])
  .findList()
  .then((result) => {
    console.log(result);
  });
where(query, …params) -> Query
queryで指定された検索条件でデータを取得します。
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | query | String | 検索条件式。paramsで指定する値は ?で指定します。 | 
    
      | params | Rest parameters | queryの条件式の中の ?を置き換えるパラメータを指定します。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .where('columnA=?', '1234')
  .findList()
  .then((result) => {
    console.log(result);
  });
where(expression) -> Query
引数:
Return:
Type: Query
join(modelClass, query, …params) -> Query
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | modelClass | Model | JOINするモデルクラスを指定します。 | 
    
      | query | String | JOIN条件、検索条件を指定します。paramsで指定する値は ?で指定します。 | 
    
      | params | Rest parameters | queryの条件式の中の ?を置き換えるパラメータを指定します。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .join(ModelB, "#ModelA.id=#ModelB.modelA_id and #ModelB.columnB=?", "abcd")
  .where('#ModelA.columnA=?', '1234')
  .findList()
  .then((result) => {
    console.log(result);
  });
join(modelClass, joinType, query, …params) -> Query
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | modelClass | Model | JOINするモデルクラスを指定します。 | 
    
      | joinType | JoinType | JOINの種類を指定します。 | 
    
      | query | String | JOIN条件、検索条件を指定します。paramsで指定する値は ?で指定します。 | 
    
      | params | Rest parameters | queryの条件式の中の ?を置き換えるパラメータを指定します。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .join(ModelB, AppPot.Model.JoinType.LeftInner, '#ModelA.id=#ModelB.modelA_id')
  .where('#ModelA.columnA=?', '1234')
  .findList()
  .then((result) => {
    console.log(result);
  });
join(modelClass, expression) -> Query
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | modelClass | Model | JOINするモデルクラスを指定します。 | 
    
      | expression | Expression |  | 
  
Return:
Type: Query
orderBy(columnName, order) -> Query
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | columnName | String | ソートの基準となるカラム名を指定します。 | 
    
      | order | (Optional) Order | 昇順、降順を指定します。指定しない場合は昇順になります。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .orderBy("columnA", AppPot.Model.Order.desc)
  .findList()
  .then((result) => {
    console.log(result);
  });
limit(limit, offset) -> Query
引数:
  
    
      | Name | Type | Description | 
  
  
    
      | limit | Number | 検索件数を指定します。 | 
    
      | offset | (optional) Number | 検索を開始するインデックスを指定します。 | 
  
Return:
Type: Query
Example
ModelA.select()
  .limit(10, 20)
  .findList()
  .then((result) => {
    console.log(result);
  });
resetQuery() -> Query
Return:
Type: Query
findOne() -> Promise
Return:
Type: Promise
Example
ModelA.select()
  .findOne()
  .then((result) => {
    console.log(result);
  });
findList(): Promise
Return:
Type: Promise
Example
ModelA.select()
  .findList()
  .then((result) => {
    console.log(result);
  });