27 #include "../../../../dataaccess/dataset/CheckConstraint.h" 28 #include "../../common/Utils.h" 35 #include <boost/cstdint.hpp> 41 if(args.Holder().IsEmpty())
42 return ::v8::ThrowException(::v8::String::New(
"In order to use the getExpression method you must use the object notation: \"exp = obj.getExpression();\""));
47 return ::v8::ThrowException(::v8::String::New(
"Invalid check constraint in the getExpression method!"));
51 ::v8::Local<::v8::String> jexp = ::v8::String::New(exp.c_str());
53 return hs.Close(jexp);
58 if(args.Length() != 1 || args[0].IsEmpty() || !args[0]->IsString() || args.Holder().IsEmpty())
59 return ::v8::ThrowException(::v8::String::New(
"In order to use the setExpression method, you must use the object notation: \"obj.setExpression(\"x > 20\");\""));
64 return ::v8::ThrowException(::v8::String::New(
"Invalid check constraint in the setExpression method!"));
66 v8::String::Utf8Value jexp(args[0]->
ToString());
70 return ::v8::Undefined();
94 return ::v8::Undefined();
101 global->Set(::v8::String::New(
"TeCheckConstraint"), jscheckconstraint->GetFunction());
111 ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
112 result->Inherit(cTpl);
114 ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
void RegisterCheckConstraint(::v8::Local<::v8::Object > &global)
It registers the CheckConstraint class.
::v8::Handle<::v8::Value > CheckConstraint_SetExpression(const ::v8::Arguments &args)
::v8::Persistent<::v8::FunctionTemplate > & GetCheckConstraintTemplate()
It returns a reference to the persistent template of a CheckConstraint object.
::v8::Handle<::v8::Value > CheckConstraint_GetExpression(const ::v8::Arguments &args)
JavaScript exporting routine for the TerraLib Data Access module.
A class that describes a check constraint.
const std::string & getExpression() const
It returns the check constraint expression.
static::v8::Persistent<::v8::FunctionTemplate > sg_checkconstraint_template
void setExpression(const std::string &e)
It sets the check constraint expression.
::v8::Handle<::v8::Value > CheckConstraint_Constructor(const ::v8::Arguments &args)
::v8::Persistent<::v8::FunctionTemplate > & GetConstraintTemplate()
It returns a reference to the persistent template of a Constraint object.
std::string ToString(const XMLCh *const value)
It converts the XML string to a standard C++ string.