text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Linq;
using System.Linq.Expressions;
using Xunit;

namespace Tests.ExpressionCompiler.Binary
{
    public static unsafe class BinaryAndTests
    {
        #region Test methods

        [Fact]
        public static void CheckByteAndTest()
        {
            byte[] array = new byte[] { 0, 1, byte.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyByteAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckSByteAndTest()
        {
            sbyte[] array = new sbyte[] { 0, 1, -1, sbyte.MinValue, sbyte.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifySByteAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckUShortAndTest()
        {
            ushort[] array = new ushort[] { 0, 1, ushort.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyUShortAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckShortAndTest()
        {
            short[] array = new short[] { 0, 1, -1, short.MinValue, short.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyShortAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckUIntAndTest()
        {
            uint[] array = new uint[] { 0, 1, uint.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyUIntAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckIntAndTest()
        {
            int[] array = new int[] { 0, 1, -1, int.MinValue, int.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyIntAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckULongAndTest()
        {
            ulong[] array = new ulong[] { 0, 1, ulong.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyULongAnd(array[i], array[j]);
                }
            }
        }

        [Fact]
        public static void CheckLongAndTest()
        {
            long[] array = new long[] { 0, 1, -1, long.MinValue, long.MaxValue };
            for (int i = 0; i < array.Length; i++)
            {
                for (int j = 0; j < array.Length; j++)
                {
                    VerifyLongAnd(array[i], array[j]);
                }
            }
        }

        #endregion

        #region Test verifiers

        private static void VerifyByteAnd(byte a, byte b)
        {
            Expression<Func<byte>> e =
                Expression.Lambda<Func<byte>>(
                    Expression.And(
                        Expression.Constant(a, typeof(byte)),
                        Expression.Constant(b, typeof(byte))),
                    Enumerable.Empty<ParameterExpression>());
            Func<byte> f = e.Compile();

            // compute with expression tree
            byte etResult = default(byte);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            byte csResult = default(byte);
            Exception csException = null;
            try
            {
                csResult = (byte)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifySByteAnd(sbyte a, sbyte b)
        {
            Expression<Func<sbyte>> e =
                Expression.Lambda<Func<sbyte>>(
                    Expression.And(
                        Expression.Constant(a, typeof(sbyte)),
                        Expression.Constant(b, typeof(sbyte))),
                    Enumerable.Empty<ParameterExpression>());
            Func<sbyte> f = e.Compile();

            // compute with expression tree
            sbyte etResult = default(sbyte);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            sbyte csResult = default(sbyte);
            Exception csException = null;
            try
            {
                csResult = (sbyte)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyUShortAnd(ushort a, ushort b)
        {
            Expression<Func<ushort>> e =
                Expression.Lambda<Func<ushort>>(
                    Expression.And(
                        Expression.Constant(a, typeof(ushort)),
                        Expression.Constant(b, typeof(ushort))),
                    Enumerable.Empty<ParameterExpression>());
            Func<ushort> f = e.Compile();

            // compute with expression tree
            ushort etResult = default(ushort);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            ushort csResult = default(ushort);
            Exception csException = null;
            try
            {
                csResult = (ushort)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyShortAnd(short a, short b)
        {
            Expression<Func<short>> e =
                Expression.Lambda<Func<short>>(
                    Expression.And(
                        Expression.Constant(a, typeof(short)),
                        Expression.Constant(b, typeof(short))),
                    Enumerable.Empty<ParameterExpression>());
            Func<short> f = e.Compile();

            // compute with expression tree
            short etResult = default(short);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            short csResult = default(short);
            Exception csException = null;
            try
            {
                csResult = (short)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyUIntAnd(uint a, uint b)
        {
            Expression<Func<uint>> e =
                Expression.Lambda<Func<uint>>(
                    Expression.And(
                        Expression.Constant(a, typeof(uint)),
                        Expression.Constant(b, typeof(uint))),
                    Enumerable.Empty<ParameterExpression>());
            Func<uint> f = e.Compile();

            // compute with expression tree
            uint etResult = default(uint);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            uint csResult = default(uint);
            Exception csException = null;
            try
            {
                csResult = (uint)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyIntAnd(int a, int b)
        {
            Expression<Func<int>> e =
                Expression.Lambda<Func<int>>(
                    Expression.And(
                        Expression.Constant(a, typeof(int)),
                        Expression.Constant(b, typeof(int))),
                    Enumerable.Empty<ParameterExpression>());
            Func<int> f = e.Compile();

            // compute with expression tree
            int etResult = default(int);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            int csResult = default(int);
            Exception csException = null;
            try
            {
                csResult = (int)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyULongAnd(ulong a, ulong b)
        {
            Expression<Func<ulong>> e =
                Expression.Lambda<Func<ulong>>(
                    Expression.And(
                        Expression.Constant(a, typeof(ulong)),
                        Expression.Constant(b, typeof(ulong))),
                    Enumerable.Empty<ParameterExpression>());
            Func<ulong> f = e.Compile();

            // compute with expression tree
            ulong etResult = default(ulong);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            ulong csResult = default(ulong);
            Exception csException = null;
            try
            {
                csResult = (ulong)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        private static void VerifyLongAnd(long a, long b)
        {
            Expression<Func<long>> e =
                Expression.Lambda<Func<long>>(
                    Expression.And(
                        Expression.Constant(a, typeof(long)),
                        Expression.Constant(b, typeof(long))),
                    Enumerable.Empty<ParameterExpression>());
            Func<long> f = e.Compile();

            // compute with expression tree
            long etResult = default(long);
            Exception etException = null;
            try
            {
                etResult = f();
            }
            catch (Exception ex)
            {
                etException = ex;
            }

            // compute with real IL
            long csResult = default(long);
            Exception csException = null;
            try
            {
                csResult = (long)(a & b);
            }
            catch (Exception ex)
            {
                csException = ex;
            }

            // either both should have failed the same way or they should both produce the same result
            if (etException != null || csException != null)
            {
                Assert.NotNull(etException);
                Assert.NotNull(csException);
                Assert.Equal(csException.GetType(), etException.GetType());
            }
            else
            {
                Assert.Equal(csResult, etResult);
            }
        }

        #endregion

        [Fact]
        public static void CannotReduce()
        {
            Expression exp = Expression.And(Expression.Constant(0), Expression.Constant(0));
            Assert.False(exp.CanReduce);
            Assert.Same(exp, exp.Reduce());
            Assert.Throws<ArgumentException>(null, () => exp.ReduceAndCheck());
        }

        [Fact]
        public static void ThrowsOnLeftNull()
        {
            Assert.Throws<ArgumentNullException>("left", () => Expression.And(null, Expression.Constant("")));
        }

        [Fact]
        public static void ThrowsOnRightNull()
        {
            Assert.Throws<ArgumentNullException>("right", () => Expression.And(Expression.Constant(""), null));
        }

        private static class Unreadable<T>
        {
            public static T WriteOnly
            {
                set { }
            }
        }

        [Fact]
        public static void ThrowsOnLeftUnreadable()
        {
            Expression value = Expression.Property(null, typeof(Unreadable<int>), "WriteOnly");
            Assert.Throws<ArgumentException>("left", () => Expression.And(value, Expression.Constant(1)));
        }

        [Fact]
        public static void ThrowsOnRightUnreadable()
        {
            Expression value = Expression.Property(null, typeof(Unreadable<int>), "WriteOnly");
            Assert.Throws<ArgumentException>("right", () => Expression.And(Expression.Constant(1), value));
        }
    }
}


text:
 Improve this doc View source
InfiniteScroll

directive in module infinite

Description

Allow infinite scroll on your page.

To use infinite scroll, you have to add infinite-scroll directive
to the element that will contain the list of elements.

Furthermore, you have to pass a method to infinite-callback attribute:
it will be executed when the bottom of the page will be reached.

If you want to reenable infinite scroll you have get first argument of this
method and call it (see example below).

Furthermore, you can pass a boolean to infinite-enable to enable or disable infinite scroll; and
an offset to infinite-offset to activate infinite scroll
before the reaching of the end of the page.

Usage

as attribute
<ANY infinite-scroll>
   ...
</ANY>

Example

In this example, I have added infinite-scroll to a div that contains an ng-repeat:

 // HTML
 <div infinite-scroll infinite-callback="functionToCall"
  infinite-enable="flag" infinite-offset="100">
     <p ng-repeat="item in data">
          {{item}}
      </p>
 </div>

 // javascript
 $scope.flag = true;

 $scope.functionToCall = function(reenableInfinite){

     // here infinite is disabled

     // here I call an API, wait response and choose if
     // re-enable infinite scroll or not
     callApiMethod(function(){
         // add elements to list

         if(youWantToReenable) {
             // re-enable infinite scroll
             reenableInfinite();
         } else {
             // do nothing
         }
     });

 }

redpajama_set_name: RedPajamaGithub


text:
module League.Types.Version
  ( Version(..)
  , VersionString(..)
  , version ) where

import Control.Applicative
import Control.Lens
import Data.Aeson
import Data.Monoid (mempty)
import Data.Text (Text, splitOn, unpack)
import Text.Read (readMaybe)
import qualified Data.Version as Version

data VersionString = VersionString Text
  deriving (Show, Read, Eq)

instance FromJSON VersionString where
  parseJSON j = VersionString <$> parseJSON j

data Version = Version [Int]
  deriving (Show, Read, Eq)

version :: Iso' Version Version.Version
version = iso (\(Version v) -> Version.Version v []) (\(Version.Version v _) -> Version v)

instance FromJSON Version where
  parseJSON (String s) =
    maybe mempty (return . Version) $
      mapM (readMaybe . unpack) (splitOn "." s)
  parseJSON _ = mempty


text:
// Copyright (C) 2014 by Tapjoy Inc.
//
// This file is part of the Tapjoy SDK.
//
// By using the Tapjoy SDK in your software, you agree to the terms of the Tapjoy SDK License Agreement.
//
// The Tapjoy SDK is bound by the Tapjoy SDK License Agreement and can be found here: https://www.tapjoy.com/sdk/license

//The Tapjoy iOS SDK.

#ifndef _TAPJOY_H
#define _TAPJOY_H

#import <UIKit/UIKit.h>
#import "TapjoyConnectConstants.h"
#import "TJPlacement.h"

#define TJC_DEPRECATION_WARNING(VERSION) __attribute__((deprecated("Go to dev.tapjoy.com for instructions on how to fix this warning")))
#define TJ_DEPRECATED_CLASS     __attribute__((deprecated("TapjoyConnect Class is deprecated, use Tapjoy Class")))
#define TJC_HIGHEST_UNSUPPORTED_SYSTEM_VERISON	@"4.3.5"

typedef void (^currencyCompletion)(NSDictionary *parameters, NSError *error);
typedef void (^networkCompletion)(BOOL success, NSError *error);

@interface TJCAdView : UIView <UIWebViewDelegate>
@end

@class TJCCurrencyManager;
@class TJCVideoManager;
@class TJCViewHandler;
@class TJCNetReachability;
@class TJCUtil;
@class TJCLog;
@class TJPlacement;

/**
 * The Tapjoy Connect Main class. This class provides all publicly available methods for developers to integrate Tapjoy into their applications.
 */
@interface Tapjoy :  NSObject

/** The application SDK key unique to this app. */
@property (nonatomic, copy) NSString *sdkKey;

/** The application ID unique to this app. */
@property (nonatomic, copy) NSString *appID;

/** The Tapjoy secret key for this applicaiton. */
@property (nonatomic, copy) NSString *secretKey;

/** The user ID, a custom ID set by the developer of an app to keep track of its unique users. */
@property (nonatomic, copy) NSString *userID;

/** The name of the plugin used. If no plugin is used, this value is set to "native" by default. */
@property (nonatomic, copy) NSString *plugin;

/** The currency multiplier value, used to adjust currency earned. */
@property (nonatomic, assign) float currencyMultiplier;

@property (nonatomic, copy) NSString *appGroupID;
@property (nonatomic, copy) NSString *store;
@property (nonatomic, copy) NSString *analyticsApiKey;
@property (nonatomic, copy) NSString *managedDeviceID;

@property (nonatomic, strong) TJCCurrencyManager *currencyManager;
@property (nonatomic, strong) TJCVideoManager *videoManager;
@property (nonatomic, strong) TJCViewHandler *viewHandler;
@property (nonatomic, strong) TJCUtil *util;
@property (nonatomic, strong) TJCLog *log;

/**
 * This method is called to initialize the Tapjoy system and notify the server that this device is running your application.
 *
 * This method should be called upon app delegate initialization in the applicationDidFinishLaunching method.
 *
 * @param sdkKey The application SDK Key. Retrieved from the app dashboard in your Tapjoy account.
 * @return n/a
 */
+ (void)connect:(NSString *)sdkKey;

/**
 * This method is called to initialize the Tapjoy system and notify the server that this device is running your application.
 *
 * This method should be called upon app delegate initialization in the applicationDidFinishLaunching method.
 *
 * @param sdkKey The application SDK Key. Retrieved from the app dashboard in your Tapjoy account.
 * @param options NSDictionary of special flags to enable non-standard settings. Valid key:value options:
 *
 * TJC_OPTION_ENABLE_LOGGING : BOOL to enable logging
 *
 * TJC_OPTION_USER_ID : NSString user id that must be set if your currency is not managed by Tapjoy. If you don't have a user id on launch you can call setUserID later
 *
 * TJC_OPTION_DISABLE_GENERIC_ERROR_ALERT : BOOL to disable our default error dialogs
 *
 * @return n/a
 */
+ (void)connect:(NSString *)sdkKey options:(NSDictionary *)optionsDict;

/**
 * Helper function to check if SDK is initialized
 */
+ (BOOL)isConnected;

/**
 *
 * This method enables/disables the debug mode of the SDK.
 * @param enabled true to enable, false to disable
 * @return n/a
 */
+ (void)setDebugEnabled:(BOOL)enabled; // default NO

/**
 * This method is called to track the session manually. If this method called, automatic session tracking will be disabled.
 *
 * @return n/a
 */
+ (void)startSession;
/**
 * This method is called to track the session manually. If this method called, automatic session tracking will be disabled.
 *
 * @return n/a
 */
+ (void)endSession;

/**
 * This method is called to set data version of your application.
 *
 * @param appDataVersion The application data version.
 * @return n/a
 */
+ (void)setAppDataVersion:(NSString *)appDataVarsion;

/**
 * This method is called to set LaunchOptions.
 * Call this method in application:didFinishLaunchingWithOptions:
 * NOTE: From 11.2.2, you don't have to call this method.
 *
 * @param launchOptions the same parameter that passed on application:didFinishLaunchingWithOptions:
 */
+ (void)setApplicationLaunchingOptions:(NSDictionary *)launchOptions TJC_DEPRECATION_WARNING(11.2.2);

/**
 * This method is called to set RemoteNotificationUserInfo.
 * Call this method in application:didReceiveRemoteNotification:
 *
 * @param userInfo the same parameter that passed on application:didReceiveRemoteNotification:
 */
+ (void)setReceiveRemoteNotification:(NSDictionary *)userInfo;

/**
 * This method is called to send APN device token to Tapjoy server.
 *
 * @param deviceToken the same parameter that passed on application:didRegisterForRemoteNotificationsWithDeviceToken:
 * @return n/a
 */
+ (void)setDeviceToken:(NSData *)deviceToken;

/**
 * This method is called to set the level of the user.
 *
 * @param userLevel
 *        the level of the user
 * @return n/a
 */
+ (void)setUserLevel:(int)userLevel;

/**
 * This method is callled to sets the friends count of the user.
 *
 * @param friendCount the number of friends
 * @return n/a
 */
+ (void)setUserFriendCount:(int)friendCount;

/**
 * This method is called to set a variable of the cohort.
 *
 * @param index the index of the cohort to set (1,2,3,4,5)
 * @param value the value of the property to set
 * @return n/a
 */
+ (void)setUserCohortVariable:(int)index value:(NSString *)value;

/**
 * Returns a string set which contains tags on the user.
 *
 * @return set of string
 */
+ (NSSet*)getUserTags;

/**
 * Sets tags for the user.
 *
 * @param tags the tags to be set
 *             can have up to 200 tags where each tag can have 200 characters
 */
+ (void)setUserTags:(NSSet *)tags;

/**
 * Removes all tags from the user.
 */
+ (void)clearUserTags;

/**
 * Adds the given tag to the user if it is not already present.
 *
 * @param tag the tag to be added
 */
+ (void)addUserTag:(NSString *)tag;

/**
 * Removes the given tag from the user if it is present.
 *
 * @param tag the tag to be removed
 */
+ (void)removeUserTag:(NSString *)tag;

/**
 * This method is called to track the purchase.
 *
 * @param productIdentifier the identifier of product
 * @param currencyCode the currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
 * @param price the price of product
 * @param campaignId the campaign id of the purchase request which initiated this purchase, can be nil
 * @param transactionId the identifier of iap transaction, if this is given, we will check receipt validation. (Available in iOS 7.0 and later)
 * @return n/a
 */
+ (void)trackPurchase:(NSString *)productIdentifier currencyCode:(NSString *)currencyCode price:(double)price campaignId:(NSString *)campaignId transactionId:(NSString *)transactionId;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// it will be improve/change API in Oct 2014
/**
 * This method is called to track an event of the given name with category, parameter1, parameter2 and values.
 *
 * @param name the name of event
 * @param category the category of event, can be nil
 * @param parameter1 the parameter of event, string type, can be nil
 * @param parameter2 the parameter of event, string type, can be nil
 * @param value the value of event
 * @param value1name the name of value1 of event
 * @param value1 the value of value1name
 * @param value2name the name of value2 of event
 * @param value2 the value of value2name
 * @param value3name the name of value3 of event
 * @param value3 the value of value3name
 * @param values NSDictionary that contains values of event (key must be string & value must be number)
 * @return n/a
 */
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2;
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2 value:(int64_t)value;
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2
        value1name:(NSString *)value1name value1:(int64_t)value1;
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2
        value1name:(NSString *)value1name value1:(int64_t)value1 value2name:(NSString *)value2name value2:(int64_t)value2;
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2
        value1name:(NSString *)value1name value1:(int64_t)value1 value2name:(NSString *)value2name value2:(int64_t)value2 value3name:(NSString *)value3name value3:(int64_t)value3;
+ (void)trackEvent:(NSString *)name category:(NSString *)category parameter1:(NSString *)parameter1 parameter2:(NSString *)parameter2 values:(NSDictionary *)values;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
 * Informs the Tapjoy server that the specified Pay-Per-Action was completed. Should be called whenever a user completes an in-game action.
 *
 * @param actionID The action ID of the completed action
 * @return n/a
 */
+ (void)actionComplete:(NSString*)actionID;

/**
 * Retrieves the globally accessible Tapjoy singleton object.
 *
 * @return The globally accessible Tapjoy singleton object.
 */
+ (id)sharedTapjoyConnect;

/**
 * Assigns a user ID for this user/device. This is used to identify the user in your application
 *
 * @param theUserID The user ID you wish to assign to this device.
 * @return n/a
 */
+ (void)setUserID:(NSString*)theUserID;
/**
 * Assigns a user ID for this user/device. This is used to identify the user in your application
 *
 * @param theUserID The user ID you wish to assign to this device.
 * @param completion The completion block that is invoked after a response is received from the server.
 * @return n/a
 */
+ (void)setUserIDWithCompletion:(NSString*)theUserID completion:(networkCompletion)completion;
/**
 * Sets the currency multiplier for virtual currency to be earned. The default is 1.0.
 *
 * Only used for non-managed (by Tapjoy) currency.
 *
 * @param mult The currency multiplier.
 * @return n/a
 */
+ (void)setCurrencyMultiplier:(float)mult TJC_DEPRECATION_WARNING(11.4.0);

/**
 * Gets the currency multiplier for virtual currency to be earned.
 *
 * @return The currency multiplier value.
 */
+ (float)getCurrencyMultiplier TJC_DEPRECATION_WARNING(11.4.0);

/**
 * Toggle logging to the console.
 *
 * @param enable YES to enable logging, NO otherwise.
 * @return n/a
 */
+ (void)enableLogging:(BOOL)enable;

/**
 * Returns the SDK version.
 *
 * @return The Tapjoy SDK version.
 */
+ (NSString*)getVersion;

@end

/**
 * The Tapjoy Video Ad Delegate Protocol.
 */
@protocol TJCVideoAdDelegate <NSObject>

@optional

/**
 * Called when a video starts playing.
 *
 * @return n/a
 */
- (void)videoAdBegan;

/**
 * Called when a video ad is closed.
 *
 * @return n/a
 */
- (void)videoAdClosed;

/**
 * Called when a video has completed playing.
 *
 * @return n/a
 */
- (void)videoAdCompleted;

/**
 * Called when a video related error occurs.
 *
 * @param errorMsg Error message.
 * @return n/a
 */
- (void)videoAdError:(NSString*)errorMsg;

@end

@interface Tapjoy (TJCCurrencyManager)

/**
 * Requests for virtual currency balance notify via TJC_GET_CURRENCY_RESPONSE_NOTIFICATION notification.
 *
 * @return n/a
 */
+ (void)getCurrencyBalance;

/**
 * Requests for virtual currency balance information.
 *
 * @param completion The completion block that is invoked after a response is received from the server.
 * @return n/a
 */
+ (void)getCurrencyBalanceWithCompletion:(currencyCompletion)completion;

/**
 * Updates the virtual currency for the user with the given spent amount of currency.
 *
 * If the spent amount exceeds the current amount of currency the user has, nothing will happen.
 * @param points The amount of currency to subtract from the current total amount of currency the user has.
 * @return n/a
 */
+ (void)spendCurrency:(int)amount;

/**
 * Updates the virtual currency for the user with the given spent amount of currency.
 *
 * If the spent amount exceeds the current amount of currency the user has, nothing will happen.
 * @param amount The amount of currency to subtract from the current total amount of currency the user has.
 * @param completion The completion block that is invoked after a response is received from the server.
 * @return n/a
 */
+ (void)spendCurrency:(int)amount completion:(currencyCompletion)completion;

/**
 * Updates the virtual currency for the user with the given awarded amount of currency.
 *
 * @param amount The amount of currency to add to the current total amount of currency the user has.
 * @return n/a
 */
+ (void)awardCurrency:(int)amount;

/**
 * Updates the virtual currency for the user with the given awarded amount of currency.
 *
 * @param amount The amount of currency to add to the current total amount of currency the user has.
 * @param completion The completion block that is invoked after a response is received from the server.
 * @return n/a
 */
+ (void)awardCurrency:(int)amount completion:(currencyCompletion)completion;

/**
 * Shows a UIAlert that tells the user how much currency they just earned.
 *
 * @return n/a
 */
+ (void)showDefaultEarnedCurrencyAlert;

@end

@interface Tapjoy (TJCVideoManager)

/**
 * Sets the class that implements the TJCVideoAdDelegate protocol.
 *
 * @param delegate The class that implements the TJCVideoAdDelegate protocol.
 * @return n/a
 */
+ (void)setVideoAdDelegate:(id<TJCVideoAdDelegate>)delegate;

@end

#endif


text:
ALTER TABLE PHONE_TABLE drop foreign key FK_FOR_ADDRESS !

ALTER TABLE ALIAS_TABLE drop foreign key FK1_FOR_CUSTOMER_TABLE !

ALTER TABLE ALIAS_TABLE drop foreign key FK2_FOR_CUSTOMER_TABLE !

ALTER TABLE FKS_ALIAS_CUSTOMER drop foreign key FK_FOR_CUSTOMER_TABLE !

ALTER TABLE FKS_ALIAS_CUSTOMER drop foreign key FK_FOR_ALIAS_TABLE !

ALTER TABLE CREDITCARD_TABLE drop foreign key FK3_FOR_CUSTOMER_TABLE !

ALTER TABLE CREDITCARD_TABLE drop foreign key FK_FOR_ORDER_TABLE !

ALTER TABLE ORDER_TABLE drop foreign key FK4_FOR_CUSTOMER_TABLE !

ALTER TABLE ORDER_TABLE drop foreign key FK0_FOR_LINEITEM_TABLE !

ALTER TABLE LINEITEM_TABLE drop foreign key FK_FOR_PRODUCT_TABLE !

ALTER TABLE LINEITEM_TABLE drop foreign key FK1_FOR_ORDER_TABLE !

ALTER TABLE CUSTOMER_TABLE drop foreign key FK5_FOR_CUSTOMER_TABLE !

ALTER TABLE CUSTOMER_TABLE drop foreign key FK6_FOR_CUSTOMER_TABLE !

ALTER TABLE BEANEJB_1X1_BI_BTOB drop foreign key FK1_FOR_AEJB_1X1_BI_BTOB !

ALTER TABLE BEANEJB_1X1_BI_BTOB drop foreign key FK2_FOR_AEJB_1X1_BI_BTOB !

ALTER TABLE BEANEJB_1X1_BI_BTOB drop foreign key FK1_FOR_BEJB_1X1_BI_BTOB !

ALTER TABLE BEANEJB_1X1_BI_BTOB drop foreign key FK2_FOR_BEJB_1X1_BI_BTOB !

ALTER TABLE BEJB_1X1_BI_BTOB drop foreign key FK_FOR_AEJB_1X1_BI_BTOB !

ALTER TABLE BEANEJB_1X1_BI_CASCADE drop foreign key FK1_FOR_AEJB_1X1_BI_CASCADE !

ALTER TABLE BEANEJB_1X1_BI_CASCADE drop foreign key FK2_FOR_AEJB_1X1_BI_CASCADE !

ALTER TABLE BEANEJB_1X1_BI_CASCADE drop foreign key FK1_FOR_BEJB_1X1_BI_CASCADE !

ALTER TABLE BEANEJB_1X1_BI_CASCADE drop foreign key FK2_FOR_BEJB_1X1_BI_CASCADE !

ALTER TABLE BEJB_1X1_BI_CASCADE drop foreign key FK_FOR_AEJB_1X1_BI_CASCADE !

ALTER TABLE BEANEJB_1X1_UNI_BTOB drop foreign key FK1_FOR_AEJB_1X1_UNI_BTOB !

ALTER TABLE BEANEJB_1X1_UNI_BTOB drop foreign key FK2_FOR_AEJB_1X1_UNI_BTOB !

ALTER TABLE BEANEJB_1X1_UNI_BTOB drop foreign key FK1_FOR_BEJB_1X1_UNI_BTOB !

ALTER TABLE BEANEJB_1X1_UNI_BTOB drop foreign key FK2_FOR_BEJB_1X1_UNI_BTOB !

ALTER TABLE BEJB_1X1_UNI_BTOB drop foreign key FK_FOR_AEJB_1X1_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK1_FOR_AEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK2_FOR_AEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK1_FOR_BEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK2_FOR_BEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK3_FOR_BEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_BTOB drop foreign key FK4_FOR_BEJB_1XM_BI_BTOB !

ALTER TABLE BEJB_1XM_BI_BTOB drop foreign key FK_FOR_AEJB_1XM_BI_BTOB !

ALTER TABLE BEANEJB_1XM_BI_CASCADE drop foreign key FK1_FOR_AEJB_1XM_BI_CASCADE !

ALTER TABLE BEANEJB_1XM_BI_CASCADE drop foreign key FK2_FOR_AEJB_1XM_BI_CASCADE !

ALTER TABLE BEANEJB_1XM_BI_CASCADE drop foreign key FK1_FOR_BEJB_1XM_BI_CASCADE !

ALTER TABLE BEANEJB_1XM_BI_CASCADE drop foreign key FK2_FOR_BEJB_1XM_BI_CASCADE !

ALTER TABLE BEJB_1XM_BI_CASCADE drop foreign key FK_FOR_AEJB_1XM_BI_CASCADE !

ALTER TABLE BEANEJB_1XM_BI_DELETE drop foreign key FK1_FOR_AEJB_1XM_BI_DELETE !

ALTER TABLE BEANEJB_1XM_BI_DELETE drop foreign key FK2_FOR_AEJB_1XM_BI_DELETE !

ALTER TABLE BEANEJB_1XM_BI_DELETE drop foreign key FK1_FOR_BEJB_1XM_BI_DELETE !

ALTER TABLE BEANEJB_1XM_BI_DELETE drop foreign key FK2_FOR_BEJB_1XM_BI_DELETE !

ALTER TABLE BEJB_1XM_BI_DELETE drop foreign key FK_FOR_AEJB_1XM_BI_DELETE !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK1_FOR_AEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK2_FOR_AEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK1_FOR_BEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK2_FOR_BEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK3_FOR_BEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_1XM_UNI_BTOB drop foreign key FK4_FOR_BEJB_1XM_UNI_BTOB !

ALTER TABLE BEJB_1XM_UNI_BTOB drop foreign key FK_FOR_AEJB_1XM_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK1_FOR_AEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK2_FOR_AEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK1_FOR_BEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK2_FOR_BEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK3_FOR_BEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_BTOB drop foreign key FK4_FOR_BEJB_MX1_UNI_BTOB !

ALTER TABLE BEJB_MX1_UNI_BTOB drop foreign key FK_FOR_AEJB_MX1_UNI_BTOB !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK1_FOR_AEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK2_FOR_AEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK1_FOR_BEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK2_FOR_BEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK3_FOR_BEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MX1_UNI_DELETE drop foreign key FK4_FOR_BEJB_MX1_UNI_DELETE !

ALTER TABLE BEJB_MX1_UNI_DELETE drop foreign key FK_FOR_AEJB_MX1_UNI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK1_FOR_AEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK2_FOR_AEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK3_FOR_AEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK4_FOR_AEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK1_FOR_BEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK2_FOR_BEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK3_FOR_BEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_BTOB drop foreign key FK4_FOR_BEJB_MXM_BI_BTOB !

ALTER TABLE FKEYS_MXM_BI_BTOB drop foreign key FK_FOR_AEJB_MXM_BI_BTOB !

ALTER TABLE FKEYS_MXM_BI_BTOB drop foreign key FK_FOR_BEJB_MXM_BI_BTOB !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK1_FOR_AEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK2_FOR_AEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK3_FOR_AEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK4_FOR_AEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK1_FOR_BEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK2_FOR_BEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK3_FOR_BEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_BI_DELETE drop foreign key FK4_FOR_BEJB_MXM_BI_DELETE !

ALTER TABLE FKEYS_MXM_BI_DELETE drop foreign key FK_FOR_AEJB_MXM_BI_DELETE !

ALTER TABLE FKEYS_MXM_BI_DELETE drop foreign key FK_FOR_BEJB_MXM_BI_DELETE !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK1_FOR_AEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK2_FOR_AEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK3_FOR_AEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK4_FOR_AEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK1_FOR_BEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK2_FOR_BEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK3_FOR_BEJB_MXM_UNI_BTOB !

ALTER TABLE BEANEJB_MXM_UNI_BTOB drop foreign key FK4_FOR_BEJB_MXM_UNI_BTOB !

ALTER TABLE FKEYS_MXM_UNI_BTOB drop foreign key FK_FOR_AEJB_MXM_UNI_BTOB !

ALTER TABLE FKEYS_MXM_UNI_BTOB drop foreign key FK_FOR_BEJB_MXM_UNI_BTOB !

ALTER TABLE FKS_ANOOP_CNOOP  drop foreign key FK2_FOR_ALIAS_TABLE !

ALTER TABLE FKS_ANOOP_CNOOP  drop foreign key FK8_FOR_CUSTOMER_TABLE !

ALTER TABLE SPOUSE_TABLE drop foreign key FK7_FOR_CUSTOMER_TABLE !

ALTER TABLE SPOUSE_TABLE drop foreign key FK_FOR_INFO_TABLE !

ALTER TABLE INFO_TABLE drop foreign key FK_FOR_SPOUSE_TABLE !

ALTER TABLE EMPLOYEE drop foreign key FK_MGR !

ALTER TABLE EMPLOYEE drop foreign key FK_DEPT !

ALTER TABLE EMPLOYEE drop foreign key FK_INS !

ALTER TABLE EMPLOYEE drop foreign key FK_PROJECT !

ALTER TABLE COMPANY drop foreign key FK_ADDRESS  !

ALTER TABLE DEPARTMENT drop foreign key FK_COMPANY !

ALTER TABLE TEAM DROP foreign key COMPANY_COMPANYID !

ALTER TABLE PERSON DROP foreign key INSURANCE_INSID !

ALTER TABLE PERSON DROP foreign key TEAM_TEAMID !

ALTER TABLE PERSON DROP foreign key PROJECT_PROJID !

ALTER TABLE PERSON_ANNUALREVIEW DROP foreign key ANNUALREVIEWS_AID !

ALTER TABLE PERSON_ANNUALREVIEW DROP foreign key PERSON_PERSONID!

ALTER TABLE PROJECT_PERSON DROP foreign key PROJECTS_PROJID!

ALTER TABLE PROJECT_PERSON DROP foreign key PERSONS_PERSONID!

ALTER TABLE PERSON_INSURANCE DROP foreign key PERSON_PERSONID !

ALTER TABLE PERSON_INSURANCE DROP foreign key INS_INSID !

ALTER TABLE ORDER1 DROP foreign key FK1_FOR_ITEM !

ALTER TABLE ORDER2 DROP foreign key FK2_FOR_ITEM !

ALTER TABLE ORDER3 DROP foreign key FK3_FOR_ITEM !

drop table ADDRESS  !
create TABLE ADDRESS (id VARCHAR(255) PRIMARY KEY, street VARCHAR(255), city VARCHAR(255), state VARCHAR(255), zip VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table PHONE_TABLE  !
create TABLE PHONE_TABLE (id VARCHAR(255) PRIMARY KEY, area VARCHAR(255), phone_number VARCHAR(255), FK_FOR_ADDRESS VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table CUSTOMER_TABLE  !
create TABLE CUSTOMER_TABLE (id VARCHAR(255) PRIMARY KEY, name VARCHAR(255) , country VARCHAR(255), code VARCHAR(255), FK5_FOR_CUSTOMER_TABLE VARCHAR(255), FK6_FOR_CUSTOMER_TABLE VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table ALIAS_TABLE  !
create TABLE ALIAS_TABLE (id VARCHAR(255) PRIMARY KEY, alias VARCHAR(255), FK1_FOR_CUSTOMER_TABLE  VARCHAR(255), FK2_FOR_CUSTOMER_TABLE  VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table FKS_ALIAS_CUSTOMER  !
create TABLE FKS_ALIAS_CUSTOMER ( FK_FOR_CUSTOMER_TABLE VARCHAR(255) , FK_FOR_ALIAS_TABLE VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table FKS_ANOOP_CNOOP !
create TABLE FKS_ANOOP_CNOOP( FK8_FOR_CUSTOMER_TABLE VARCHAR(255) , FK2_FOR_ALIAS_TABLE VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table CREDITCARD_TABLE  !
create TABLE CREDITCARD_TABLE (ID VARCHAR(255) PRIMARY KEY, TYPE VARCHAR(255), EXPIRES VARCHAR(255), APPROVED NUMERIC, CREDITCARD_NUMBER VARCHAR(255), BALANCE DOUBLE PRECISION, FK3_FOR_CUSTOMER_TABLE VARCHAR(255), FK_FOR_ORDER_TABLE VARCHAR(255) ) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table ORDER_TABLE  !
create TABLE  ORDER_TABLE (ID VARCHAR(255) PRIMARY KEY, TOTALPRICE DOUBLE PRECISION , FK4_FOR_CUSTOMER_TABLE VARCHAR(255), FK0_FOR_LINEITEM_TABLE VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table PRODUCT_DETAILS !
create TABLE PRODUCT_DETAILS ( ID VARCHAR(255)  PRIMARY KEY , WHOUSE VARCHAR(255) , LICENSE_KEY INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1 !

drop table PRODUCT_TABLE !
CREATE TABLE PRODUCT_TABLE (id VARCHAR(255) PRIMARY KEY, name VARCHAR(255), price float, quantity integer, pnum integer, PRODUCT_TYPE VARCHAR(255), INCEPTION DATE NULL, SOLD DATE NULL, MODEL integer, REV float ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE PRICED_PRODUCT_TABLE !
CREATE TABLE PRICED_PRODUCT_TABLE (ID VARCHAR(255) PRIMARY KEY , NAME VARCHAR(255), PRICE FLOAT, QUANTITY INTEGER, PNUM INTEGER ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

drop table SPOUSE_TABLE !
create TABLE SPOUSE_TABLE (ID VARCHAR(255) PRIMARY KEY,  FIRSTNAME VARCHAR(255), MAIDENNAME VARCHAR(255), LASTNAME VARCHAR(255), SOCSECNUM VARCHAR(255), FK7_FOR_CUSTOMER_TABLE VARCHAR(255), FK_FOR_INFO_TABLE VARCHAR(255) ) ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table INFO_TABLE !
create TABLE INFO_TABLE (ID VARCHAR(255) PRIMARY KEY, INFOSTREET VARCHAR(255), INFOCITY VARCHAR(255), INFOSTATE VARCHAR(255), INFOZIP VARCHAR(255), FK_FOR_SPOUSE_TABLE VARCHAR(255) ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

drop table LINEITEM_TABLE  !
create TABLE LINEITEM_TABLE (id VARCHAR(255) PRIMARY KEY, quantity integer, FK_FOR_PRODUCT_TABLE VARCHAR(255), FK1_FOR_ORDER_TABLE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE PHONE_TABLE add ( constraint FK_FOR_ADDRESS Foreign Key (FK_FOR_ADDRESS) references ADDRESS(id) ON DELETE CASCADE ) !

ALTER TABLE ALIAS_TABLE add ( constraint FK1_FOR_CUSTOMER_TABLE Foreign Key (FK1_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE ALIAS_TABLE add ( constraint FK2_FOR_CUSTOMER_TABLE Foreign Key (FK2_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE FKS_ALIAS_CUSTOMER  add ( constraint FK_FOR_CUSTOMER_TABLE Foreign Key (FK_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE FKS_ALIAS_CUSTOMER  add ( constraint FK_FOR_ALIAS_TABLE Foreign Key (FK_FOR_ALIAS_TABLE) references ALIAS_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE FKS_ANOOP_CNOOP  add ( constraint FK2_FOR_ALIAS_TABLE Foreign Key (FK2_FOR_ALIAS_TABLE) references ALIAS_TABLE(id) ON DELETE CASCADE)!

ALTER TABLE FKS_ANOOP_CNOOP  add (constraint FK8_FOR_CUSTOMER_TABLE Foreign Key (FK8_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE)!

ALTER TABLE CREDITCARD_TABLE add ( constraint FK3_FOR_CUSTOMER_TABLE Foreign Key (FK3_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE CREDITCARD_TABLE add ( constraint FK_FOR_ORDER_TABLE Foreign Key (FK_FOR_ORDER_TABLE) references ORDER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE ORDER_TABLE add ( constraint FK4_FOR_CUSTOMER_TABLE Foreign Key (FK4_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE ORDER_TABLE add ( constraint FK0_FOR_LINEITEM_TABLE Foreign Key (FK0_FOR_LINEITEM_TABLE) references LINEITEM_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE LINEITEM_TABLE add ( constraint FK_FOR_PRODUCT_TABLE Foreign Key (FK_FOR_PRODUCT_TABLE) references PRODUCT_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE LINEITEM_TABLE add ( constraint FK1_FOR_ORDER_TABLE Foreign Key (FK1_FOR_ORDER_TABLE) references ORDER_TABLE(id) ON DELETE CASCADE ) !

ALTER TABLE CUSTOMER_TABLE add ( constraint FK5_FOR_CUSTOMER_TABLE Foreign Key (FK5_FOR_CUSTOMER_TABLE) references ADDRESS(id) ON DELETE CASCADE ) !

ALTER TABLE CUSTOMER_TABLE add ( constraint FK6_FOR_CUSTOMER_TABLE Foreign Key (FK6_FOR_CUSTOMER_TABLE) references ADDRESS(id) ON DELETE CASCADE ) !

ALTER TABLE SPOUSE_TABLE add (constraint FK7_FOR_CUSTOMER_TABLE Foreign Key(FK7_FOR_CUSTOMER_TABLE) references CUSTOMER_TABLE(ID) ON DELETE CASCADE) !

ALTER TABLE SPOUSE_TABLE add (constraint FK_FOR_INFO_TABLE Foreign Key (FK_FOR_INFO_TABLE) references INFO_TABLE(ID) ON DELETE CASCADE) !

ALTER TABLE INFO_TABLE add (constraint FK_FOR_SPOUSE_TABLE Foreign Key (FK_FOR_SPOUSE_TABLE) references SPOUSE_TABLE(ID) ON DELETE CASCADE) !

drop table BEANEJB_1X1_BI_BTOB  !
create TABLE BEANEJB_1X1_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1X1_BI_BTOB VARCHAR(255), FK2_FOR_AEJB_1X1_BI_BTOB VARCHAR(255), FK1_FOR_BEJB_1X1_BI_BTOB VARCHAR(255), FK2_FOR_BEJB_1X1_BI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1X1_BI_BTOB  !
create TABLE  AEJB_1X1_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1X1_BI_BTOB  !
create TABLE BEJB_1X1_BI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1X1_BI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1X1_BI_BTOB add ( constraint FK1_FOR_AEJB_1X1_BI_BTOB Foreign Key (FK1_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_BI_BTOB add ( constraint FK2_FOR_AEJB_1X1_BI_BTOB Foreign Key (FK2_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_BI_BTOB add ( constraint FK1_FOR_BEJB_1X1_BI_BTOB Foreign Key (FK1_FOR_BEJB_1X1_BI_BTOB) references BEJB_1X1_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_BI_BTOB add ( constraint FK2_FOR_BEJB_1X1_BI_BTOB Foreign Key (FK2_FOR_BEJB_1X1_BI_BTOB) references BEJB_1X1_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEJB_1X1_BI_BTOB add ( constraint FK_FOR_AEJB_1X1_BI_BTOB Foreign Key (FK_FOR_AEJB_1X1_BI_BTOB) references AEJB_1X1_BI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_1X1_BI_CASCADE  !
create TABLE BEANEJB_1X1_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255), FK2_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255), FK1_FOR_BEJB_1X1_BI_CASCADE VARCHAR(255), FK2_FOR_BEJB_1X1_BI_CASCADE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1X1_BI_CASCADE  !
create TABLE  AEJB_1X1_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1X1_BI_CASCADE  !
create TABLE BEJB_1X1_BI_CASCADE ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1X1_BI_CASCADE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1X1_BI_CASCADE add ( constraint FK1_FOR_AEJB_1X1_BI_CASCADE Foreign Key (FK1_FOR_AEJB_1X1_BI_CASCADE) references AEJB_1X1_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1X1_BI_CASCADE add ( constraint FK2_FOR_AEJB_1X1_BI_CASCADE Foreign Key (FK2_FOR_AEJB_1X1_BI_CASCADE) references AEJB_1X1_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1X1_BI_CASCADE add ( constraint FK1_FOR_BEJB_1X1_BI_CASCADE Foreign Key (FK1_FOR_BEJB_1X1_BI_CASCADE) references BEJB_1X1_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1X1_BI_CASCADE add ( constraint FK2_FOR_BEJB_1X1_BI_CASCADE Foreign Key (FK2_FOR_BEJB_1X1_BI_CASCADE) references BEJB_1X1_BI_CASCADE(id)) !

ALTER TABLE BEJB_1X1_BI_CASCADE add ( constraint FK_FOR_AEJB_1X1_BI_CASCADE Foreign Key (FK_FOR_AEJB_1X1_BI_CASCADE) references AEJB_1X1_BI_CASCADE(id)) !

drop table BEANEJB_1X1_UNI_BTOB  !
create TABLE BEANEJB_1X1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255), FK2_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255), FK1_FOR_BEJB_1X1_UNI_BTOB VARCHAR(255), FK2_FOR_BEJB_1X1_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1X1_UNI_BTOB  !
create TABLE  AEJB_1X1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1X1_UNI_BTOB  !
create TABLE BEJB_1X1_UNI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1X1_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1X1_UNI_BTOB add ( constraint FK1_FOR_AEJB_1X1_UNI_BTOB Foreign Key (FK1_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_UNI_BTOB add ( constraint FK2_FOR_AEJB_1X1_UNI_BTOB Foreign Key (FK2_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_UNI_BTOB add ( constraint FK1_FOR_BEJB_1X1_UNI_BTOB Foreign Key (FK1_FOR_BEJB_1X1_UNI_BTOB) references BEJB_1X1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1X1_UNI_BTOB add ( constraint FK2_FOR_BEJB_1X1_UNI_BTOB Foreign Key (FK2_FOR_BEJB_1X1_UNI_BTOB) references BEJB_1X1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEJB_1X1_UNI_BTOB add ( constraint FK_FOR_AEJB_1X1_UNI_BTOB Foreign Key (FK_FOR_AEJB_1X1_UNI_BTOB) references AEJB_1X1_UNI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_1XM_BI_BTOB  !
create TABLE BEANEJB_1XM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1XM_BI_BTOB VARCHAR(255), FK2_FOR_AEJB_1XM_BI_BTOB VARCHAR(255), FK1_FOR_BEJB_1XM_BI_BTOB VARCHAR(255), FK2_FOR_BEJB_1XM_BI_BTOB VARCHAR(255), FK3_FOR_BEJB_1XM_BI_BTOB VARCHAR(255), FK4_FOR_BEJB_1XM_BI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1XM_BI_BTOB  !
create TABLE  AEJB_1XM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1XM_BI_BTOB  !
create TABLE BEJB_1XM_BI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1XM_BI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK1_FOR_AEJB_1XM_BI_BTOB Foreign Key (FK1_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK2_FOR_AEJB_1XM_BI_BTOB Foreign Key (FK2_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK1_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK1_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK2_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK2_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK3_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK3_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_BI_BTOB add ( constraint FK4_FOR_BEJB_1XM_BI_BTOB Foreign Key (FK4_FOR_BEJB_1XM_BI_BTOB) references BEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEJB_1XM_BI_BTOB add ( constraint FK_FOR_AEJB_1XM_BI_BTOB Foreign Key (FK_FOR_AEJB_1XM_BI_BTOB) references AEJB_1XM_BI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_1XM_BI_CASCADE  !
create TABLE BEANEJB_1XM_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255), FK2_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255), FK1_FOR_BEJB_1XM_BI_CASCADE VARCHAR(255), FK2_FOR_BEJB_1XM_BI_CASCADE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1XM_BI_CASCADE  !
create TABLE  AEJB_1XM_BI_CASCADE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1XM_BI_CASCADE  !
create TABLE BEJB_1XM_BI_CASCADE ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1XM_BI_CASCADE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1XM_BI_CASCADE add ( constraint FK1_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK1_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1XM_BI_CASCADE add ( constraint FK2_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK2_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1XM_BI_CASCADE add ( constraint FK1_FOR_BEJB_1XM_BI_CASCADE Foreign Key (FK1_FOR_BEJB_1XM_BI_CASCADE) references BEJB_1XM_BI_CASCADE(id)) !

ALTER TABLE BEANEJB_1XM_BI_CASCADE add ( constraint FK2_FOR_BEJB_1XM_BI_CASCADE Foreign Key (FK2_FOR_BEJB_1XM_BI_CASCADE) references BEJB_1XM_BI_CASCADE(id)) !

ALTER TABLE BEJB_1XM_BI_CASCADE add ( constraint FK_FOR_AEJB_1XM_BI_CASCADE Foreign Key (FK_FOR_AEJB_1XM_BI_CASCADE) references AEJB_1XM_BI_CASCADE(id)) !

drop table BEANEJB_1XM_BI_DELETE  !
create TABLE BEANEJB_1XM_BI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1XM_BI_DELETE VARCHAR(255), FK2_FOR_AEJB_1XM_BI_DELETE VARCHAR(255), FK1_FOR_BEJB_1XM_BI_DELETE VARCHAR(255), FK2_FOR_BEJB_1XM_BI_DELETE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1XM_BI_DELETE  !
create TABLE  AEJB_1XM_BI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1XM_BI_DELETE  !
create TABLE BEJB_1XM_BI_DELETE ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1XM_BI_DELETE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1XM_BI_DELETE add ( constraint FK1_FOR_AEJB_1XM_BI_DELETE Foreign Key (FK1_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_1XM_BI_DELETE add ( constraint FK2_FOR_AEJB_1XM_BI_DELETE Foreign Key (FK2_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_1XM_BI_DELETE add ( constraint FK1_FOR_BEJB_1XM_BI_DELETE Foreign Key (FK1_FOR_BEJB_1XM_BI_DELETE) references BEJB_1XM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_1XM_BI_DELETE add ( constraint FK2_FOR_BEJB_1XM_BI_DELETE Foreign Key (FK2_FOR_BEJB_1XM_BI_DELETE) references BEJB_1XM_BI_DELETE(id)) !

ALTER TABLE BEJB_1XM_BI_DELETE add ( constraint FK_FOR_AEJB_1XM_BI_DELETE Foreign Key (FK_FOR_AEJB_1XM_BI_DELETE) references AEJB_1XM_BI_DELETE(id)) !

drop table BEANEJB_1XM_UNI_BTOB  !
create TABLE BEANEJB_1XM_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255), FK2_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255), FK1_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255), FK2_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255), FK3_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255), FK4_FOR_BEJB_1XM_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_1XM_UNI_BTOB  !
create TABLE  AEJB_1XM_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_1XM_UNI_BTOB  !
create TABLE BEJB_1XM_UNI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_1XM_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK1_FOR_AEJB_1XM_UNI_BTOB Foreign Key (FK1_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK2_FOR_AEJB_1XM_UNI_BTOB Foreign Key (FK2_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK1_FOR_BEJB_1XM_UNI_BTOB Foreign Key (FK1_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK2_FOR_BEJB_1XM_UNI_BTOB Foreign Key (FK2_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK3_FOR_BEJB_1XM_UNI_BTOB Foreign Key (FK3_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_1XM_UNI_BTOB add ( constraint FK4_FOR_BEJB_1XM_UNI_BTOB Foreign Key (FK4_FOR_BEJB_1XM_UNI_BTOB) references BEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEJB_1XM_UNI_BTOB add ( constraint FK_FOR_AEJB_1XM_UNI_BTOB Foreign Key (FK_FOR_AEJB_1XM_UNI_BTOB) references AEJB_1XM_UNI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_MX1_UNI_BTOB  !
create TABLE BEANEJB_MX1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255), FK2_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255), FK1_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255), FK2_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255), FK3_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255), FK4_FOR_BEJB_MX1_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_MX1_UNI_BTOB  !
create TABLE  AEJB_MX1_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_MX1_UNI_BTOB  !
create TABLE BEJB_MX1_UNI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK1_FOR_AEJB_MX1_UNI_BTOB Foreign Key (FK1_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK2_FOR_AEJB_MX1_UNI_BTOB Foreign Key (FK2_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK1_FOR_BEJB_MX1_UNI_BTOB Foreign Key (FK1_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK2_FOR_BEJB_MX1_UNI_BTOB Foreign Key (FK2_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK3_FOR_BEJB_MX1_UNI_BTOB Foreign Key (FK3_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MX1_UNI_BTOB add ( constraint FK4_FOR_BEJB_MX1_UNI_BTOB Foreign Key (FK4_FOR_BEJB_MX1_UNI_BTOB) references BEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEJB_MX1_UNI_BTOB add ( constraint FK_FOR_AEJB_MX1_UNI_BTOB Foreign Key (FK_FOR_AEJB_MX1_UNI_BTOB) references AEJB_MX1_UNI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_MX1_UNI_DELETE  !
create TABLE BEANEJB_MX1_UNI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255) , FK2_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255) , FK1_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) , FK2_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) , FK3_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) , FK4_FOR_BEJB_MX1_UNI_DELETE VARCHAR(255) )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_MX1_UNI_DELETE  !
create TABLE  AEJB_MX1_UNI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_MX1_UNI_DELETE  !
create TABLE BEJB_MX1_UNI_DELETE ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL, FK_FOR_AEJB_MX1_UNI_DELETE VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK1_FOR_AEJB_MX1_UNI_DELETE Foreign Key (FK1_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK2_FOR_AEJB_MX1_UNI_DELETE Foreign Key (FK2_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK1_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK1_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK2_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK2_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK3_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK3_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEANEJB_MX1_UNI_DELETE add ( constraint FK4_FOR_BEJB_MX1_UNI_DELETE Foreign Key (FK4_FOR_BEJB_MX1_UNI_DELETE) references BEJB_MX1_UNI_DELETE(id)) !

ALTER TABLE BEJB_MX1_UNI_DELETE add ( constraint FK_FOR_AEJB_MX1_UNI_DELETE Foreign Key (FK_FOR_AEJB_MX1_UNI_DELETE) references AEJB_MX1_UNI_DELETE(id)) !

drop table BEANEJB_MXM_BI_BTOB  !
create TABLE BEANEJB_MXM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) , FK2_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) , FK3_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) , FK4_FOR_AEJB_MXM_BI_BTOB VARCHAR(255) , FK1_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) , FK2_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) , FK3_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) , FK4_FOR_BEJB_MXM_BI_BTOB VARCHAR(255) )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_MXM_BI_BTOB  !
create TABLE  AEJB_MXM_BI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_MXM_BI_BTOB  !
create TABLE BEJB_MXM_BI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table FKEYS_MXM_BI_BTOB  !
create TABLE FKEYS_MXM_BI_BTOB ( FK_FOR_AEJB_MXM_BI_BTOB  VARCHAR(255), FK_FOR_BEJB_MXM_BI_BTOB  VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK1_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK1_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK2_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK2_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK3_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK3_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK4_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK4_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK1_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK1_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK2_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK2_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK3_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK3_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_BI_BTOB add ( constraint FK4_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK4_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE FKEYS_MXM_BI_BTOB add ( constraint FK_FOR_AEJB_MXM_BI_BTOB Foreign Key (FK_FOR_AEJB_MXM_BI_BTOB) references AEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE FKEYS_MXM_BI_BTOB add ( constraint FK_FOR_BEJB_MXM_BI_BTOB Foreign Key (FK_FOR_BEJB_MXM_BI_BTOB) references BEJB_MXM_BI_BTOB(id) ON DELETE CASCADE ) !

drop table BEANEJB_MXM_BI_DELETE  !
create TABLE BEANEJB_MXM_BI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) , FK2_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) , FK3_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) , FK4_FOR_AEJB_MXM_BI_DELETE VARCHAR(255) , FK1_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) , FK2_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) , FK3_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) , FK4_FOR_BEJB_MXM_BI_DELETE VARCHAR(255) )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_MXM_BI_DELETE  !
create TABLE  AEJB_MXM_BI_DELETE ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_MXM_BI_DELETE  !
create TABLE BEJB_MXM_BI_DELETE ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table FKEYS_MXM_BI_DELETE  !
create TABLE FKEYS_MXM_BI_DELETE ( FK_FOR_AEJB_MXM_BI_DELETE  VARCHAR(255), FK_FOR_BEJB_MXM_BI_DELETE  VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK1_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK1_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK2_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK2_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK3_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK3_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK4_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK4_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK1_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK1_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK2_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK2_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK3_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK3_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id)) !

ALTER TABLE BEANEJB_MXM_BI_DELETE add ( constraint FK4_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK4_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id)) !

ALTER TABLE FKEYS_MXM_BI_DELETE add ( constraint FK_FOR_AEJB_MXM_BI_DELETE Foreign Key (FK_FOR_AEJB_MXM_BI_DELETE) references AEJB_MXM_BI_DELETE(id)) !

ALTER TABLE FKEYS_MXM_BI_DELETE add ( constraint FK_FOR_BEJB_MXM_BI_DELETE Foreign Key (FK_FOR_BEJB_MXM_BI_DELETE) references BEJB_MXM_BI_DELETE(id)) !

drop table BEANEJB_MXM_UNI_BTOB  !
create TABLE BEANEJB_MXM_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL, FK1_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) , FK2_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) , FK3_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) , FK4_FOR_AEJB_MXM_UNI_BTOB VARCHAR(255) , FK1_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) , FK2_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) , FK3_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) , FK4_FOR_BEJB_MXM_UNI_BTOB VARCHAR(255) )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table AEJB_MXM_UNI_BTOB  !
create TABLE  AEJB_MXM_UNI_BTOB ( id VARCHAR(255)  PRIMARY KEY, name VARCHAR(255) , value NUMERIC NOT NULL)  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table BEJB_MXM_UNI_BTOB  !
create TABLE BEJB_MXM_UNI_BTOB ( id  VARCHAR(255) PRIMARY KEY, name VARCHAR(255), value NUMERIC NOT NULL )  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table FKEYS_MXM_UNI_BTOB  !
create TABLE FKEYS_MXM_UNI_BTOB ( FK_FOR_AEJB_MXM_UNI_BTOB  VARCHAR(255), FK_FOR_BEJB_MXM_UNI_BTOB  VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK1_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK1_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK2_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK2_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK3_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK3_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK4_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK4_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK1_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK1_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK2_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK2_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK3_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK3_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE BEANEJB_MXM_UNI_BTOB add ( constraint FK4_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK4_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE FKEYS_MXM_UNI_BTOB add ( constraint FK_FOR_AEJB_MXM_UNI_BTOB Foreign Key (FK_FOR_AEJB_MXM_UNI_BTOB) references AEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

ALTER TABLE FKEYS_MXM_UNI_BTOB add ( constraint FK_FOR_BEJB_MXM_UNI_BTOB Foreign Key (FK_FOR_BEJB_MXM_UNI_BTOB) references BEJB_MXM_UNI_BTOB(id) ON DELETE CASCADE ) !

DROP TABLE PKEY !
CREATE TABLE PKEY ( PMIDINTEGER INTEGER  NOT NULL, PMIDSTRING VARCHAR(25) NOT NULL, PMIDFLOAT REAL NOT NULL, BRANDNAME VARCHAR(255) , PRICE REAL ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE DATATYPES !
CREATE TABLE DATATYPES ( BOOLEANDATA SMALLINT NULL, CHARDATA CHAR NULL, SHORTDATA SMALLINT NULL, INTDATA INTEGER NULL, LONGDATA NUMERIC NULL, DBLDATA DOUBLE PRECISION NULL, FLOATDATA REAL NULL, ID INTEGER AUTO_INCREMENT PRIMARY KEY, ENUMODATA INTEGER NULL, ENUMSDATA VARCHAR(25), BYTEDATA SMALLINT NULL ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE DATATYPES2  !
CREATE TABLE DATATYPES2 ( DATATYPES2_ID DATE NOT NULL, TIMEDATA DATE, TSDATA DATE, BYTEDATA BLOB, CHARDATA VARCHAR(448), CONSTRAINT PK_DATATYPES2 PRIMARY KEY (DATATYPES2_ID))  ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE GENERATOR_TABLE !
CREATE TABLE GENERATOR_TABLE (PK_COL VARCHAR(10) NOT NULL, VAL_COL INTEGER ) ENGINE=innoDB DEFAULT CHARSET=latin1 !
INSERT into GENERATOR_TABLE(PK_COL, VAL_COL) values ('DT_ID', 1) !

DROP TABLE SEQUENCE !
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(10) PRIMARY KEY NOT NULL, SEQ_COUNT INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1 !
INSERT into SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0) !

DROP TABLE EMPLOYEE !
CREATE TABLE EMPLOYEE (HIREDATE DATE NULL, ID NUMERIC NOT NULL, FIRSTNAME VARCHAR(255) NULL, SALARY REAL NOT NULL, LASTNAME VARCHAR(255) NULL, STATUS VARCHAR(255), FK_MGR NUMERIC ,  FK_PROJECT INTEGER , FK_INS INTEGER , FK_DEPT NUMERIC , CONSTRAINT PK_EMPLOYEE PRIMARY KEY(ID) ) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE DEPARTMENT !
CREATE TABLE DEPARTMENT (NAME VARCHAR(255) NULL, ID NUMERIC PRIMARY KEY NOT NULL,  COMPANY_COMPANYID INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE COFFEE !
CREATE TABLE COFFEE (ID INTEGER PRIMARY KEY NOT NULL, BRANDNAME VARCHAR(25), PRICE REAL ) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE COMPANY !
CREATE TABLE COMPANY (COMPANYID INTEGER PRIMARY KEY NOT NULL, NAME VARCHAR(25), ADDRESS_ID VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1 !
DROP TABLE TEAM !
CREATE TABLE TEAM (NAME VARCHAR(255) NULL, TEAMID INTEGER PRIMARY KEY NOT NULL,  COMPANY_COMPANYID INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE COMPANY ADD ( CONSTRAINT FK_ADDRESS FOREIGN KEY (ADDRESS_ID) REFERENCES ADDRESS (ID) ON DELETE CASCADE )!
ALTER TABLE DEPARTMENT ADD ( CONSTRAINT FK_COMPANY FOREIGN KEY (COMPANY_COMPANYID) REFERENCES COMPANY (COMPANYID) ON DELETE CASCADE )!
ALTER TABLE TEAM ADD ( CONSTRAINT COMPANY_COMPANYID FOREIGN KEY (COMPANY_COMPANYID) REFERENCES COMPANY(COMPANYID) ON DELETE CASCADE ) !

DROP TABLE PROJECT!
CREATE TABLE PROJECT (PROJID INTEGER PRIMARY KEY NOT NULL, NAME VARCHAR(25), BUDGET NUMERIC ) ENGINE=innoDB DEFAULT CHARSET=latin1 !
DROP TABLE PERSON !
CREATE TABLE PERSON (PERSONID INTEGER PRIMARY KEY NOT NULL, FIRSTNAME VARCHAR(255) NULL, LASTNAME VARCHAR(255) NULL, PROJECT_PROJID INTEGER NULL, INSURANCE_INSID INTEGER NULL, TEAM_TEAMID INTEGER NULL) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE ANNUALREVIEW !
CREATE TABLE ANNUALREVIEW (AID INTEGER PRIMARY KEY NOT NULL, SERVICE INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE INSURANCE !
CREATE TABLE INSURANCE (INSID INTEGER PRIMARY KEY NOT NULL, CARRIER VARCHAR(255) ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE PROJECT_PERSON !
CREATE TABLE PROJECT_PERSON (PROJECTS_PROJID INTEGER , PERSONS_PERSONID INTEGER ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE PERSON_ANNUALREVIEW !
CREATE TABLE PERSON_ANNUALREVIEW (PERSON_PERSONID INTEGER, ANNUALREVIEWS_AID INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE PERSON_INSURANCE !
CREATE TABLE PERSON_INSURANCE (PERSON_PERSONID INTEGER, INSURANCE_INSID INTEGER ) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE PURCHASE_ORDER !
CREATE TABLE PURCHASE_ORDER (ID NUMERIC NOT NULL, TOTAL INTEGER, CONSTRAINT PURCHASE_ORDER PRIMARY KEY (ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !

ALTER TABLE EMPLOYEE ADD ( CONSTRAINT FK_MGR FOREIGN KEY (FK_MGR) REFERENCES EMPLOYEE (ID) ) !

ALTER TABLE EMPLOYEE ADD ( CONSTRAINT FK_DEPT FOREIGN KEY (FK_DEPT) REFERENCES DEPARTMENT (ID) )!

ALTER TABLE EMPLOYEE ADD ( CONSTRAINT FK_PROJECT FOREIGN KEY (FK_PROJECT) REFERENCES PROJECT (PROJID) )!

ALTER TABLE EMPLOYEE ADD ( CONSTRAINT FK_INS FOREIGN KEY (FK_INS) REFERENCES INSURANCE (INSID) )!

ALTER TABLE PERSON ADD ( CONSTRAINT TEAM_TEAMID FOREIGN KEY (TEAM_TEAMID) REFERENCES TEAM(TEAMID) ) !

ALTER TABLE PERSON ADD ( CONSTRAINT PROJECT_PROJID FOREIGN KEY (PROJECT_PROJID) REFERENCES PROJECT(PROJID)) !

ALTER TABLE PERSON ADD ( CONSTRAINT INSURANCE_INSID FOREIGN KEY (INSURANCE_INSID) REFERENCES INSURANCE(INSID)) !

ALTER TABLE PROJECT_PERSON ADD ( CONSTRAINT PROJECTS_PROJID FOREIGN KEY (PROJECTS_PROJID) references PROJECT(PROJID) ) !

ALTER TABLE PROJECT_PERSON ADD ( CONSTRAINT PERSONS_PERSONID FOREIGN KEY (PERSONS_PERSONID) references PERSON(PERSONID) ) !

ALTER TABLE PERSON_ANNUALREVIEW ADD ( CONSTRAINT ANNUALREVIEWS_AID FOREIGN KEY (ANNUALREVIEWS_AID) references ANNUALREVIEW(AID))  !

ALTER TABLE PERSON_ANNUALREVIEW ADD ( CONSTRAINT PERSON_PERSONID FOREIGN KEY (PERSON_PERSONID) references PERSON(PERSONID) )  !

ALTER TABLE PERSON_INSURANCE ADD ( CONSTRAINT P_PERSONID FOREIGN KEY (PERSON_PERSONID) references PERSON(PERSONID) ) !

ALTER TABLE PERSON_INSURANCE  ADD ( CONSTRAINT INS_INSID FOREIGN KEY (INSURANCE_INSID) references INSURANCE(INSID) )  !

drop table ORDER3 !
CREATE TABLE ORDER3 (ID VARCHAR(255) PRIMARY KEY, totalPrice DOUBLE PRECISION , FK3_FOR_ITEM VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1 !

drop table ORDER1 !
CREATE TABLE ORDER1 (ID VARCHAR(255) PRIMARY KEY, totalPrice DOUBLE PRECISION , FK1_FOR_ITEM VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

drop table ORDER2 !
CREATE TABLE ORDER2 (ID VARCHAR(255) PRIMARY KEY, totalPrice DOUBLE PRECISION , FK2_FOR_ITEM VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE ITEM !
CREATE TABLE ITEM (ID VARCHAR(255) PRIMARY KEY, ITEMNAME VARCHAR(255))  ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE ORDER1 add ( constraint FK1_FOR_ITEM Foreign Key (FK1_FOR_ITEM) references ITEM(ID) ) !
ALTER TABLE ORDER2 add ( constraint FK2_FOR_ITEM Foreign Key (FK2_FOR_ITEM) references ITEM(ID) ) !
ALTER TABLE ORDER3 add ( constraint FK3_FOR_ITEM Foreign Key (FK3_FOR_ITEM) references ITEM(ID) ) !

DROP TABLE MEMBER !
CREATE TABLE MEMBER (MEMBER_ID INTEGER NOT NULL, MEMBER_NAME VARCHAR(255), DUES SMALLINT, VERSION INTEGER, DONATION NUMERIC, CONSTRAINT PK_MEMBER PRIMARY KEY (MEMBER_ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE ACCOUNT !
CREATE TABLE ACCOUNT (ID INTEGER NOT NULL, BALANCE DOUBLE PRECISION, DEPOSIT DOUBLE PRECISION, WITHDRAW DOUBLE PRECISION, CONSTRAINT PK_ACCOUNT PRIMARY KEY (ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !


text:
#ifndef UTILSOS_ADDITIVEELECTRONICCONTRIBUTION_H
#define UTILSOS_ADDITIVEELECTRONICCONTRIBUTION_H

#include <Utils/DataStructures/SpinAdaptedMatrix.h>
#include <Utils/Math/AutomaticDifferentiation/MethodsTypesHelper.h>

namespace Scine {
namespace Utils {

class SpinAdaptedMatrix;
class DensityMatrix;

/**
 * @class AdditiveElectronicContribution @file AdditiveElectronicContribution.h
 * This class represents an additive electronic contribution.
 * On one sides it stores the matrix with the matrix elements, on the other side
 * it is an interface for the addDerivatives<Utils::Derivative O> methods in the derived classes.
 */
class AdditiveElectronicContribution {
 public:
  /** Virtual destructor. */
  virtual ~AdditiveElectronicContribution() = default;

  /**
   * @brief Function to identify the density dependence of the electronic contribution.
   */
  virtual bool isDensityDependent() const = 0;

  /**
   * @brief Function to check if a contribution is already present. Does not check for correctness.
   */
  virtual bool isValid() const {
    return isValid_;
  };

  /**
   * @brief Function to check if a contribution in form of matrix is present.
   */
  virtual bool hasMatrixContribution() const {
    return hasMatrixContribution_;
  }
  /**
   * @brief Invalidates the contribution, which has to be set again.
   */
  void invalidate() {
    isValid_ = false;
  }
  /**
   * @brief Setter function.
   * @param contribution The matrix containing the electronic contributions.
   */
  void setElectronicContribution(const SpinAdaptedMatrix& contribution) {
    electronicContribution_ = contribution;
    isValid_ = true;
  }

  /**
   * @brief Getter for the electronic contributions.
   */
  const SpinAdaptedMatrix& getElectronicContribution() const {
    return electronicContribution_;
  }

  /**
   * @brief Returns the energy contribution. It needs the density matrix for the contraction of the matrix elements.
   */
  virtual double getElectronicEnergyContribution() const = 0;
  /**
   * @brief Calculates the energy contribution.
   * For example, calculates the dipole-field interaction energy.
   */
  virtual void calculate(const DensityMatrix& densityMatrix, DerivativeOrder order) = 0;
  /**
   * @brief Functions to calculate the first derivatives of the electronic contribution.
   * @param derivativeContainer A container for the derivatives up to the first order.
   */
  virtual void addDerivatives(AutomaticDifferentiation::DerivativeContainerType<Derivative::First>& derivativeContainer) const = 0;
  /**
   * @brief Functions to calculate the atomic second derivatives of the electronic contribution.
   * @param derivativeContainer A container for the atomic derivatives up to the second order.
   */
  virtual void
  addDerivatives(AutomaticDifferentiation::DerivativeContainerType<Derivative::SecondAtomic>& derivativeContainer) const = 0;
  /**
   * @brief Functions to calculate the second derivatives of the electronic contribution.
   * @param derivativeContainer A container for the derivatives up to the second order.
   */
  virtual void
  addDerivatives(AutomaticDifferentiation::DerivativeContainerType<Derivative::SecondFull>& derivativeContainer) const = 0;

 private:
  SpinAdaptedMatrix electronicContribution_;
  bool isValid_{false};
  bool hasMatrixContribution_{false};
};

} // namespace Utils
} // namespace Scine

#endif // UTILSOS_ADDITIVEELECTRONICCONTRIBUTION_H


text:
"use strict";

var path = '../';

jest.autoMockOff();
jest.mock('../../../api/user');

describe('Leaderboard component', function() {
  var React       = require('react/addons');
  var user        = require('../../../api/user');
  var TestUtils   = React.addons.TestUtils;
  var findByClass = TestUtils.findRenderedDOMComponentWithClass;
  var Leaderboard = require(path);
  var Component;

  beforeEach(function() {
    user.getTopTracks.mockClear();
    Component = TestUtils.renderIntoDocument(<Leaderboard />);
  });

  describe('When data is requested', function() {
    it('makes one correct request for the data', function() {
      expect(user.getTopTracks.mock.calls.length).toEqual(1);
    });

    it('runs a callback function', function() {
      expect(user.getTopTracks).toBeCalledWith(Component.setTopTracks);
    });

    it('shows a specified number of results', function() {

    });

    it('shows results for a specified period', function() {

    });
  });

  describe('When no data is returned', function() {
    beforeEach(function() {
      Component.setTopTracks(null);
    });

    it('adds an error class to the container element', function() {
      var element = findByClass(Component, "Leaderboard--error");
      var errorMsg = findByClass(Component, "Leaderboard__error-msg");

      expect(element).toBeDefined();
      expect(errorMsg).toBeDefined();
    });

    it('attempts to re-load itself', function() {
      expect(user.getTopTracks).toBeCalledWith(Component.setPlayCount);
      expect(user.getTopTracks.mock.calls.length > 1).toBeTruthy();
    });
  });

  describe('When the component is loading', function() {
    it('displays a loading icon by default', function() {
      var spinner = findByClass(Component, "Leaderboard__spinner");
      expect(spinner).toBeDefined();
    });
  });

  describe('When data is retreived', function() {
    beforeEach(function() {
      Component.setState({
        loading: false,
        topTracks: [
          {
            artist: "foo",
            album: "bar",
            track: "baz",
            img: "http://test.com/placeholder.jpg",
            rank: 1,
            playcount: 45,
            weight: 0.45
          },
          {
            artist: "test",
            album: "song",
            track: "data",
            img: "http://test.com/derp.jpg",
            rank: 1,
            playcount: 45,
            weight: 0.45
          },
          {
            artist: "test",
            album: "song",
            track: "data",
            img: "http://test.com/derp.jpg",
            rank: 3,
            playcount: 10,
            weight: 0.1
          }
        ]
      });
    });

    it('displays multiple leaderboard items', function() {

    });

    it('displays a track, album and artist name in each result', function() {

    });

    it('orders the results based on rank', function() {

    });

    it('graphs the playcount against total plays using weight field', function() {

    });
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-->
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
  version="1.0">
  <entity class="org.apache.shindig.social.opensocial.jpa.AccountDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ActivityDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.AddressDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.BodyTypeDb">
  </entity>
  <entity
    class="org.apache.shindig.social.opensocial.jpa.MediaItemDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.NameDb">
  </entity>
  <entity
    class="org.apache.shindig.social.opensocial.jpa.OrganizationDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PersonDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.UrlDb">
  </entity>
  <entity
    class="org.apache.shindig.social.opensocial.jpa.ListFieldDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.MessageDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ActivityTemplateParamsDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.OrganizationAddressDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.EmailDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ImDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PersonAccountDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PersonAddressDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PersonOrganizationDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PhoneDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PhotoDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.PersonPropertyDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.FriendDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.FriendPropertyDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.GroupDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.GroupPropertyDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ApplicationDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ApplicationPropertyDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ApplicationDataMapDb">
  </entity>
  <entity class="org.apache.shindig.social.opensocial.jpa.ApplicationDataMapValueDb">
  </entity>
</entity-mappings>


text:
[![Build Status](https://circleci.com/gh/ubiratansoares/reactive-architectures-playground.svg?style=shield&circle-token=6aa6dfc358b4aefd33c374915401ba0f92f8bc50)](https://circleci.com/gh/ubiratansoares/reactive-architectures-playground)
[![codecov.io](https://codecov.io/gh/ubiratansoares/reactive-architectures-playground/branch/master/graph/badge.svg)](https://codecov.io/gh/ubiratansoares/reactive-architectures-playground)

# Reactive MVP Playground

Sample companheiro para minha apresentação / blog post

`Evoluindo arquiteturas reativas`

[Slides](https://speakerdeck.com/ubiratansoares/evoluindo-arquiteturas-reativas)

[Blog](https://ubiratansoares.github.io/reactive-architectures)

Essa demo implementa uma chamada `GET` simples para [NumbersAPI](http://numbersapi.com/)

e ilustra uma série de idéias, dentre as quais

- Como estruturar as camadas de uma aplicação ao estilo de MVP/Clean de forma 100% reativa (com RxJava2), incluindo comportamentos segregados e modelos separados por camadas
- Uso de _Dependency Injection_ com as novas APIs da Dagger 2.11+, incluindo `AndroidInjector`, `@ContributesAndroidInjector` e afins
- Testes de unidade nas camadas nos níveis de unidade e integração, e como criar um robo de verificação de comportamentos para Presenters
- ETC

## Setup

Essa demo usa Android Studio / Android Gradle Plugin 3.0+ e é 100% escrita em Java

## License
```
The MIT License (MIT)

Copyright (c) 2017 Ubiratan Soares

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```


text:
package appinsights

import (
	crand "crypto/rand"
	"encoding/binary"
	"io"
	"math/rand"
	"sync"
	"time"

	"github.com/gofrs/uuid"
)

// uuidGenerator is a wrapper for gofrs/uuid, an active fork of satori/go.uuid used for a few reasons:
//   - Avoids build failures due to version differences when a project imports us but
//     does not respect our vendoring. (satori/go.uuid#77, #71, #66, ...)
//   - Avoids error output when creaing new UUID's: if the crypto reader fails,
//     this will fallback on the standard library PRNG, since this is never used
//     for a sensitive application.
//   - Uses io.ReadFull to guarantee fully-populated UUID's (satori/go.uuid#73)
type uuidGenerator struct {
	sync.Mutex
	fallbackRand *rand.Rand
	reader       io.Reader
}

var uuidgen *uuidGenerator = newUuidGenerator(crand.Reader)

// newUuidGenerator creates a new uuiGenerator with the specified crypto random reader.
func newUuidGenerator(reader io.Reader) *uuidGenerator {
	// Setup seed for fallback random generator
	var seed int64
	b := make([]byte, 8)
	if _, err := io.ReadFull(reader, b); err == nil {
		seed = int64(binary.BigEndian.Uint64(b))
	} else {
		// Otherwise just use the timestamp
		seed = time.Now().UTC().UnixNano()
	}

	return &uuidGenerator{
		reader:       reader,
		fallbackRand: rand.New(rand.NewSource(seed)),
	}
}

// newUUID generates a new V4 UUID
func (gen *uuidGenerator) newUUID() uuid.UUID {
	//call the standard generator
	u, err := uuid.NewV4()
	//err will be either EOF or unexpected EOF
	if err != nil {
		gen.fallback(&u)
	}

	return u
}

// fallback populates the specified UUID with the standard library's PRNG
func (gen *uuidGenerator) fallback(u *uuid.UUID) {
	gen.Lock()
	defer gen.Unlock()
	// This does not fail as per documentation
	gen.fallbackRand.Read(u[:])
	u.SetVersion(uuid.V4)
	u.SetVariant(uuid.VariantRFC4122)
}

// newUUID generates a new V4 UUID
func newUUID() uuid.UUID {
	return uuidgen.newUUID()
}