// Path: src/com/njkremer/Sqlite/JoinExecutor.java
// public class JoinExecutor {
//     
//     /**
//      * User to represent various join types for a database.
//      */
//     public enum JoinType {
//         INNER("inner "), 
//         LEFT_OUTER("left outer "), 
//         RIGHT_OUTER("right outer ");
//         
//         JoinType(String sql) {
//             this.sql = sql;
//         }
//         
//         public String getSql() {
//             return sql;
//         }
// 
//         private String sql;
//     }
// 
//     public JoinExecutor join(Class<?> leftClazz, String leftField, Class<?> rightClazz, String rightField) {
//         String rightClassName = rightClazz.getSimpleName().toLowerCase();
//         String leftClassName = leftClazz.getSimpleName().toLowerCase();
//         String joinTypeSql = "";
//         if (joinType != null) {
//             joinTypeSql = this.joinType.getSql();
//         }
//         query = String.format(JOIN, joinTypeSql, leftClassName, leftClassName, leftField, rightClassName, rightField);
//         return this;
//     }
//     
//     public void setJoinType(JoinType joinType) {
//         this.joinType = joinType;
//     }
// 
//     String getQuery() {
//         return query;
//     }
// 
//     private final static String JOIN = "%sjoin %s on %s.%s = %s.%s ";
//     private JoinType joinType = null;
//     private String query;
// }
// 
// Path: src/com/njkremer/Sqlite/JoinExecutor.java
// public enum JoinType {
//     INNER("inner "), 
//     LEFT_OUTER("left outer "), 
//     RIGHT_OUTER("right outer ");
//         
//     JoinType(String sql) {
//         this.sql = sql;
//     }
//         
//     public String getSql() {
//         return sql;
//     }
// 
//     private String sql;
// }
// 
// Path: test/com/njkremer/Sqlite/TestClass/User.java
// public class User {
//     @AutoIncrement
//     @PrimaryKey
//     private long id;
//     private String name;
//     private String password;
//     
//     @OneToMany("userId")
//     private List<Thing> things;
// 
//     public long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// 
//     public List<Thing> getThings() {
//         return things;
//     }
// 
//     public void setThings(List<Thing> things) {
//         this.things = things;
//     }
//     
// 
// }
// 
// Path: test/com/njkremer/Sqlite/TestClass/UserAccessGroup.java
// public class UserAccessGroup {
// 
//     public long getUserId() {
//         return userId;
//     }
//     public void setUserId(long userId) {
//         this.userId = userId;
//     }
//     public long getGroupId() {
//         return groupId;
//     }
//     public void setGroupId(long groupId) {
//         this.groupId = groupId;
//     }
//     
//     private long userId;
//     private long groupId;
// }


import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.njkremer.Sqlite.JoinExecutor;
import com.njkremer.Sqlite.JoinExecutor.JoinType;
import com.njkremer.Sqlite.TestClass.User;
import com.njkremer.Sqlite.TestClass.UserAccessGroup;
package com.njkremer.Sqlite;




public class TU_JoinExecutor {

    @Test
    public void testJoin() {
        JoinExecutor joinExecutor = new JoinExecutor();
        joinExecutor.join(UserAccessGroup.class, "userId", User.class, "id");
        
        assertEquals("join useraccessgroup on useraccessgroup.userId = user.id ", joinExecutor.getQuery());
    }
    
    @Test
    public void testInnerJoin() {
        JoinExecutor joinExecutor = new JoinExecutor();
        joinExecutor.setJoinType(JoinType.INNER);
        joinExecutor.join(UserAccessGroup.class, "userId", User.class, "id");
        
        assertEquals("inner join useraccessgroup on useraccessgroup.userId = user.id ", joinExecutor.getQuery());
    }
    
    @Test
// Path: src/com/njkremer/Sqlite/JoinExecutor.java
// public class JoinExecutor {
//     
//     /**
//      * User to represent various join types for a database.
//      */
//     public enum JoinType {
//         INNER("inner "), 
//         LEFT_OUTER("left outer "), 
//         RIGHT_OUTER("right outer ");
//         
//         JoinType(String sql) {
//             this.sql = sql;
//         }
//         
//         public String getSql() {
//             return sql;
//         }
// 
//         private String sql;
//     }
// 
//     public JoinExecutor join(Class<?> leftClazz, String leftField, Class<?> rightClazz, String rightField) {
//         String rightClassName = rightClazz.getSimpleName().toLowerCase();
//         String leftClassName = leftClazz.getSimpleName().toLowerCase();
//         String joinTypeSql = "";
//         if (joinType != null) {
//             joinTypeSql = this.joinType.getSql();
//         }
//         query = String.format(JOIN, joinTypeSql, leftClassName, leftClassName, leftField, rightClassName, rightField);
//         return this;
//     }
//     
//     public void setJoinType(JoinType joinType) {
//         this.joinType = joinType;
//     }
// 
//     String getQuery() {
//         return query;
//     }
// 
//     private final static String JOIN = "%sjoin %s on %s.%s = %s.%s ";
//     private JoinType joinType = null;
//     private String query;
// }
// 
// Path: src/com/njkremer/Sqlite/JoinExecutor.java
// public enum JoinType {
//     INNER("inner "), 
//     LEFT_OUTER("left outer "), 
//     RIGHT_OUTER("right outer ");
//         
//     JoinType(String sql) {
//         this.sql = sql;
//     }
//         
//     public String getSql() {
//         return sql;
//     }
// 
//     private String sql;
// }
// 
// Path: test/com/njkremer/Sqlite/TestClass/User.java
// public class User {
//     @AutoIncrement
//     @PrimaryKey
//     private long id;
//     private String name;
//     private String password;
//     
//     @OneToMany("userId")
//     private List<Thing> things;
// 
//     public long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// 
//     public List<Thing> getThings() {
//         return things;
//     }
// 
//     public void setThings(List<Thing> things) {
//         this.things = things;
//     }
//     
// 
// }
// 
// Path: test/com/njkremer/Sqlite/TestClass/UserAccessGroup.java
// public class UserAccessGroup {
// 
//     public long getUserId() {
//         return userId;
//     }
//     public void setUserId(long userId) {
//         this.userId = userId;
//     }
//     public long getGroupId() {
//         return groupId;
//     }
//     public void setGroupId(long groupId) {
//         this.groupId = groupId;
//     }
//     
//     private long userId;
//     private long groupId;
// }


// Path: test/com/njkremer/Sqlite/TU_JoinExecutor.java
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.njkremer.Sqlite.JoinExecutor;
import com.njkremer.Sqlite.JoinExecutor.JoinType;
import com.njkremer.Sqlite.TestClass.User;
import com.njkremer.Sqlite.TestClass.UserAccessGroup;

package com.njkremer.Sqlite;




public class TU_JoinExecutor {

    @Test
    public void testJoin() {
        JoinExecutor joinExecutor = new JoinExecutor();
        joinExecutor.join(UserAccessGroup.class, "userId", User.class, "id");
        
        assertEquals("join useraccessgroup on useraccessgroup.userId = user.id ", joinExecutor.getQuery());
    }
    
    @Test
    public void testInnerJoin() {
        JoinExecutor joinExecutor = new JoinExecutor();
        joinExecutor.setJoinType(JoinType.INNER);
        joinExecutor.join(UserAccessGroup.class, "userId", User.class, "id");
        
        assertEquals("inner join useraccessgroup on useraccessgroup.userId = user.id ", joinExecutor.getQuery());
    }
    
    @Test
    public void testLeftOuterJoin() {