19 namespace Deveel.Data.Sql.Tables {
24 public struct RowId : IEquatable<RowId> {
39 public RowId(
int tableId,
int rowNumber)
41 RowNumber = rowNumber;
53 public int TableId {
get;
private set; }
58 public int RowNumber {
get;
private set; }
64 public bool IsNull {
get;
private set; }
67 if (IsNull && other.
IsNull)
70 return TableId.Equals(other.
TableId) &&
74 public override bool Equals(
object obj) {
78 return Equals((RowId) obj);
85 return unchecked (TableId.GetHashCode() ^ RowNumber.GetHashCode());
89 return String.Format(
"{0}-{1}", TableId, RowNumber);
106 if (String.IsNullOrEmpty(s))
109 var index = s.IndexOf(
"-", StringComparison.Ordinal);
113 var s1 = s.Substring(0, index);
114 var s2 = s.Substring(index + 1);
118 if (!Int32.TryParse(s1, out v1))
120 if (!Int32.TryParse(s2, out v2))
123 value =
new RowId(v1, v2);
140 if (!TryParse(s, out rowId))
141 throw new FormatException(
"Unable to parse the given string into a valid ROWID.");
override bool Equals(object obj)
bool IsNull
Gets a boolean value indicating if the object equivales to a NULL.
override int GetHashCode()
int RowNumber
Gets the number of the column within the table referenced.
static RowId Parse(string s)
Parses the given input string into an instance of RowId.
RowId(int tableId, int rowNumber)
Constructs the object with the references to the given table unique ID and the number of the row with...
Defines the value of a ROWID object, that is a unique reference within a database system to a single ...
static bool TryParse(string s, out RowId value)
Attempts to parse the input string given into a valid instance of RowId.
override string ToString()
int TableId
Gets the unique identifier of the table the row is contained.