-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #375 from aaberg/rewrite-reflection-and-add-record…
…-support Rewrite reflection and add record support
- Loading branch information
Showing
69 changed files
with
760 additions
and
1,699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 18 additions & 166 deletions
184
core/src/main/java/org/sql2o/DefaultResultSetHandlerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.sql2o; | ||
|
||
import org.sql2o.tools.SnakeToCamelCase; | ||
|
||
import java.util.Map; | ||
|
||
public class NamingConvention { | ||
|
||
private final boolean caseSensitive; | ||
private final boolean autoDeriveColumnNames; | ||
|
||
public NamingConvention(boolean caseSensitive, boolean autoDeriveColumnNames) { | ||
this.caseSensitive = caseSensitive; | ||
this.autoDeriveColumnNames = autoDeriveColumnNames; | ||
} | ||
|
||
public String deriveName(String name) { | ||
var derivedName = name; | ||
|
||
if (autoDeriveColumnNames) { | ||
derivedName = SnakeToCamelCase.convert(derivedName); | ||
} | ||
if (!caseSensitive) | ||
derivedName = derivedName.toLowerCase(); | ||
|
||
return derivedName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.sql2o; | ||
|
||
import org.sql2o.quirks.Quirks; | ||
|
||
public class Settings { | ||
|
||
private final Quirks quirks; | ||
private final NamingConvention namingConvention; | ||
private final boolean throwOnMappingError; | ||
|
||
public Settings(NamingConvention namingConvention, Quirks quirks, boolean throwOnMappingError) { | ||
this.quirks = quirks; | ||
this.namingConvention = namingConvention; | ||
this.throwOnMappingError = throwOnMappingError; | ||
} | ||
|
||
public Quirks getQuirks() { | ||
return quirks; | ||
} | ||
|
||
public NamingConvention getNamingConvention() { | ||
return namingConvention; | ||
} | ||
|
||
public boolean isThrowOnMappingError(){ | ||
return throwOnMappingError; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
core/src/main/java/org/sql2o/converters/DefaultConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.sql2o.converters; | ||
|
||
public class DefaultConverter extends ConverterBase<Object> { | ||
@Override | ||
public Object convert(Object val) throws ConverterException { | ||
return val; | ||
} | ||
} |
Oops, something went wrong.