Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
emilforslund
committed
May 5, 2015
1 parent
bc885bb
commit 9f53373
Showing
14 changed files
with
99 additions
and
28 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
52 changes: 52 additions & 0 deletions
52
...n/java/com/speedment/orm/core/manager/sql/generator/StringBinaryPredicateBuilderView.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,52 @@ | |||
/** | |||
* | |||
* Copyright (c) 2006-2015, Speedment, Inc. All Rights Reserved. | |||
* | |||
* Licensed 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. | |||
*/ | |||
package com.speedment.orm.core.manager.sql.generator; | |||
|
|||
import com.speedment.codegen.base.Generator; | |||
import com.speedment.codegen.base.Transform; | |||
import com.speedment.orm.field.StandardBinaryOperator; | |||
import com.speedment.orm.field.StandardStringBinaryOperator; | |||
import com.speedment.orm.field.reference.string.StringBinaryPredicateBuilder; | |||
import java.util.Optional; | |||
|
|||
/** | |||
* | |||
* @author Emil Forslund | |||
*/ | |||
public class StringBinaryPredicateBuilderView implements Transform<StringBinaryPredicateBuilder, String> { | |||
|
|||
protected String render(StandardStringBinaryOperator op) { | |||
switch (op) { | |||
// case CONTAINS : return ""; | |||
// case ENDS_WITH : return ""; | |||
// case EQUAL_IGNORE_CASE : return ""; | |||
// case NOT_EQUAL_IGNORE_CASE : return ""; | |||
// case STARTS_WITH : return ""; | |||
default : throw new UnsupportedOperationException( | |||
"Unknown enum constant " + op.name() + "." | |||
); | |||
} | |||
} | |||
|
|||
@Override | |||
public Optional<String> transform(Generator gen, StringBinaryPredicateBuilder model) { | |||
return Optional.of( | |||
model.getField().getColumn().getName() + | |||
render(model.getOperator()) | |||
); | |||
} | |||
} |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
package com.speedment.orm.field; | |||
|
|||
/** | |||
* | |||
* @author Emil Forslund | |||
*/ | |||
public interface BinaryOperator extends Operator { | |||
|
|||
} |
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
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
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