/// <summary> /// copy the MBO attributes to current MBO /// </summary> public void CopyAll(YPF.Comercial.RRCC.SUP.ChangeLogImpl entity) { this._isNew = entity._isNew; this.__operationType = entity.__operationType; this.__rootEntityType = entity.__rootEntityType; this.__rootSurrogateKey = entity.__rootSurrogateKey; this.__entityType = entity.__entityType; this.__surrogateKey = entity.__surrogateKey; }
/// <summary> /// Get the mobile business object by surrogate key. /// </summary> /// <param name="id">surrogate key</param> /// <returns>the mobile business object for the surroget key</returns> /// <exception cref="ObjectNotFoundException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static YPF.Comercial.RRCC.SUP.ChangeLogImpl Load(YPF.Comercial.RRCC.SUP.ChangeLogKey id) { YPF.Comercial.RRCC.SUP.ChangeLogImpl _ent = Find(id); if (_ent == null) { throw new Sybase.Persistence.ObjectNotFoundException(); } return(_ent); }
/// <summary> /// Set current MBO attributes by specified MBO. /// </summary> public static YPF.Comercial.RRCC.SUP.ChangeLogImpl Merge(YPF.Comercial.RRCC.SUP.ChangeLogImpl entity) { YPF.Comercial.RRCC.SUP.ChangeLogImpl ent = Find(entity._pk()); if (ent == null) { ent = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); } ent.CopyAll(entity); ent.Save(); return(ent); }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object, bool __buildGraph, bool _includeBigAttribute, bool _includeUserAttributes) { if ((_object == null)) { return(null); } else { return(_object._toJSON(__buildGraph, _includeBigAttribute, _includeUserAttributes)); } }
/// <summary> /// Refresh the mobile business object from database. /// </summary> public void Refresh() { if (!_isNew) { YPF.Comercial.RRCC.SUP.ChangeLogImpl ent = Load(_pk()); CopyAll(ent); _isNew = false; _isDirty = false; } }
/// <summary> /// Sybase internal use only. /// <summary> public static com.sybase.afx.json.JsonObject __toJSON(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object, bool _includeBigAttribute) { if (_includeBigAttribute) { return(YPF.Comercial.RRCC.SUP.ChangeLogImpl.ToJSON(_object)); } else { return(YPF.Comercial.RRCC.SUP.ChangeLogImpl.ToJSONWithoutBigAttribute(_object)); } }
internal static YPF.Comercial.RRCC.SUP.ChangeLogImpl FromJSON(object _json) { if (_json == null) { return(null); } else { YPF.Comercial.RRCC.SUP.ChangeLogImpl _obj = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); _obj._fromJSON((com.sybase.afx.json.JsonObject)_json); return(_obj); } }
/// <summary> /// override method /// </summary> public override bool Equals(object that) { YPF.Comercial.RRCC.SUP.ChangeLogImpl that_1 = that as YPF.Comercial.RRCC.SUP.ChangeLogImpl; if (that_1 == null) { return(false); } YPF.Comercial.RRCC.SUP.ChangeLogKey id_2 = this._pk(); YPF.Comercial.RRCC.SUP.ChangeLogKey id_3 = that_1._pk(); if ((id_2 == null) || (id_3 == null)) { return(false); } return(id_2.Equals(id_3)); }
/// <summary> /// Find a List of ChangeLogImpl /// </summary> /// <param name="query">The query to be filter.</param> /// <exception cref="PersistenceException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl> FindWithQuery(Sybase.Persistence.Query query) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); try { query.SetEntity(META_DATA); query.SetDatabaseMetaData(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Metadata); int count_2 = 0; Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl> list_3 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl>(); if (query.Take == 0) { return(list_3); } com.sybase.afx.db.DynamicQuery query_4 = new com.sybase.afx.db.DynamicQuery(); System.Data.IDbCommand ps_5 = query_4.CreateCommand(_conn, query); System.Data.IDataReader rs_6 = ps_5.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_6)) { YPF.Comercial.RRCC.SUP.ChangeLogImpl entity_9 = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); entity_9.Bind(profile, rs_6); list_3.Add(entity_9); count_2++; } if (rs_6 != null) { com.sybase.afx.db.ReaderUtil.Close(profile, rs_6, count_2); } if (ps_5 != null) { ps_5.Dispose(); } return(list_3); } catch (Sybase.Persistence.PersistenceException ex_10) { throw ex_10; } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
private static YPF.Comercial.RRCC.SUP.ChangeLogImpl _find(YPF.Comercial.RRCC.SUP.ChangeLogKey id, String sql, bool findOs, bool findNonPending) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); System.Data.IDataReader _rs = null; int count = 0; try { YPF.Comercial.RRCC.SUP.ChangeLogImpl _rt = null; System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "entityType", id.EntityType); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "surrogateKey", id.SurrogateKey); _rs = ps.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs)) { _rt = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); _rt.Bind(profile, _rs); count++; } if (_rs != null) { com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count); } if (ps != null) { ps.Dispose(); } return(_rt); } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
private static YPF.Comercial.RRCC.SUP.ChangeLogImpl _find(YPF.Comercial.RRCC.SUP.ChangeLogKey id, String sql, bool findOs, bool findNonPending) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); System.Data.IDataReader _rs = null; int count = 0; try { YPF.Comercial.RRCC.SUP.ChangeLogImpl _rt = null; System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "entityType", id.EntityType); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "surrogateKey", id.SurrogateKey); _rs = ps.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs)) { _rt = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); _rt.Bind(profile, _rs); count++; } if (_rs != null) com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count); if (ps != null) ps.Dispose(); return _rt; } catch(System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object, bool __buildGraph, bool _includeBigAttribute) { return(ToJSON(_object, __buildGraph, _includeBigAttribute, true)); }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object) { return(YPF.Comercial.RRCC.SUP.ChangeLogImpl.ToJSON(_object, false, true, true)); }
internal static com.sybase.afx.json.JsonObject ToJSONWithoutUserAttributes(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object) { return(YPF.Comercial.RRCC.SUP.ChangeLogImpl.ToJSON(_object, false, false, false)); }
/// <summary> /// Sybase internal use only. /// <summary> public static com.sybase.afx.json.JsonObject __toJSON(YPF.Comercial.RRCC.SUP.ChangeLogImpl _object) { return(YPF.Comercial.RRCC.SUP.ChangeLogImpl.ToJSON(_object)); }
private void CreateBySQL(Sybase.Persistence.ConnectionWrapper _conn, string sql, YPF.Comercial.RRCC.SUP.ChangeLogImpl __theObject) { System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetChar(_conn.GetConnectionProfile(), ps, "operationType", __theObject.OperationType); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "rootEntityType", __theObject.RootEntityType); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "rootSurrogateKey", __theObject.RootSurrogateKey); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "entityType", __theObject.EntityType); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "surrogateKey", __theObject.SurrogateKey); ps.ExecuteNonQuery(); ps.Dispose();; }
/// <summary> /// Set current MBO attributes by specified MBO. /// </summary> public static YPF.Comercial.RRCC.SUP.ChangeLogImpl Merge(YPF.Comercial.RRCC.SUP.ChangeLogImpl entity) { YPF.Comercial.RRCC.SUP.ChangeLogImpl ent = Find(entity._pk()); if (ent == null) { ent = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); } ent.CopyAll(entity); ent.Save(); return ent; }
/// <summary> /// Find a List of ChangeLogImpl /// </summary> /// <param name="query">The query to be filter.</param> /// <exception cref="PersistenceException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.ChangeLogImpl> FindWithQuery(Sybase.Persistence.Query query) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); try { query.SetEntity(META_DATA); query.SetDatabaseMetaData(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Metadata); int count_2 = 0; Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.ChangeLogImpl> list_3 = new Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.ChangeLogImpl>(); if(query.Take == 0) { return list_3; } com.sybase.afx.db.DynamicQuery query_4 = new com.sybase.afx.db.DynamicQuery(); System.Data.IDbCommand ps_5 = query_4.CreateCommand(_conn, query); System.Data.IDataReader rs_6 = ps_5.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_6)) { YPF.Comercial.RRCC.SUP.ChangeLogImpl entity_9 = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); entity_9.Bind(profile, rs_6); list_3.Add(entity_9); count_2++; } if (rs_6 != null) com.sybase.afx.db.ReaderUtil.Close(profile, rs_6, count_2); if (ps_5 != null) ps_5.Dispose(); return list_3; } catch (Sybase.Persistence.PersistenceException ex_10) { throw ex_10; } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
internal static YPF.Comercial.RRCC.SUP.ChangeLogImpl FromJSON(object _json) { if (_json == null) { return null; } else { YPF.Comercial.RRCC.SUP.ChangeLogImpl _obj = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); _obj._fromJSON((com.sybase.afx.json.JsonObject)_json); return _obj; } }