|
using System;
using System.Collections.Generic;
using System.Text;
namespace SQLiteParser
{
public class SQLiteUniqueColumnConstraint : SQLiteColumnConstraint
{
private SQLiteUniqueColumnConstraint(string name)
: base(name)
{
}
public SQLiteUniqueColumnConstraint(string name, SQLiteResolveAction conf)
: base(name)
{
_conf = conf;
}
public SQLiteResolveAction ResolveAction
{
get { return _conf; }
set { _conf = value; }
}
public override bool Equals(object obj)
{
if (obj == null)
return false;
SQLiteUniqueColumnConstraint dst = obj as SQLiteUniqueColumnConstraint;
if (dst == null)
return false;
if (_conf != dst._conf)
return false;
return base.Equals(obj);
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
if (this.ConstraintName != null)
sb.Append("CONSTRAINT " + this.ConstraintName + " ");
sb.Append("UNIQUE");
if (_conf != SQLiteResolveAction.None)
sb.Append(" " + Utils.GetConflictClauseString(_conf));
return sb.ToString();
}
public override object Clone()
{
SQLiteUniqueColumnConstraint res = new SQLiteUniqueColumnConstraint(this.ConstraintName);
res._conf = _conf;
return res;
}
private SQLiteResolveAction _conf;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My name is Liron Levi and I'm developing software for fun & profit for 15 years already.