Skip to content

Commit bfee97b

Browse files
author
synapticloop
committed
added in alltypes
1 parent 536ade9 commit bfee97b

13 files changed

+382
-0
lines changed

src/main/java/synapticloop/h2zero/base/manager/BaseConnectionManager.java

+56
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,22 @@ public static void setBinary(PreparedStatement preparedStatement, int parameterI
265265
}
266266
}
267267

268+
public static void setBinaryInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
269+
if(null == inputStream) {
270+
preparedStatement.setNull(parameterIndex, Types.BINARY);
271+
} else {
272+
preparedStatement.setBinaryStream(parameterIndex, inputStream);
273+
}
274+
}
275+
276+
public static void setVarbinaryInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
277+
if(null == inputStream) {
278+
preparedStatement.setNull(parameterIndex, Types.BINARY);
279+
} else {
280+
preparedStatement.setBinaryStream(parameterIndex, inputStream);
281+
}
282+
}
283+
268284
/**
269285
* Set a VARBINARY datatype to a prepared statement with the value of the passed
270286
* in String, or the correct SQL null type if null
@@ -785,6 +801,14 @@ public static void setBlobInputStream(PreparedStatement preparedStatement, int p
785801
}
786802
}
787803

804+
public static void setMediumblobInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
805+
if(null == inputStream) {
806+
preparedStatement.setNull(parameterIndex, Types.BLOB);
807+
} else {
808+
preparedStatement.setBlob(parameterIndex, inputStream);
809+
}
810+
}
811+
788812
/**
789813
* Set a BLOB datatype to a prepared statement with the value of the passed in Blob, or the correct SQL null type
790814
* if null
@@ -839,6 +863,38 @@ public static void setLongtext(PreparedStatement preparedStatement, int paramete
839863
}
840864
}
841865

866+
public static void setLongtextInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
867+
if(null == inputStream) {
868+
preparedStatement.setNull(parameterIndex, Types.BLOB);
869+
} else {
870+
preparedStatement.setAsciiStream(parameterIndex, inputStream);
871+
}
872+
}
873+
874+
public static void setTinytextInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
875+
if(null == inputStream) {
876+
preparedStatement.setNull(parameterIndex, Types.BLOB);
877+
} else {
878+
preparedStatement.setAsciiStream(parameterIndex, inputStream);
879+
}
880+
}
881+
882+
public static void setTextInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
883+
if(null == inputStream) {
884+
preparedStatement.setNull(parameterIndex, Types.BLOB);
885+
} else {
886+
preparedStatement.setAsciiStream(parameterIndex, inputStream);
887+
}
888+
}
889+
890+
public static void setMediumtextInputStream(PreparedStatement preparedStatement, int parameterIndex, InputStream inputStream) throws SQLException {
891+
if(null == inputStream) {
892+
preparedStatement.setNull(parameterIndex, Types.BLOB);
893+
} else {
894+
preparedStatement.setAsciiStream(parameterIndex, inputStream);
895+
}
896+
}
897+
842898
/**
843899
* Set a Longtext datatype to a prepared statement with the value of the passed in InputStream, or the correct
844900
* SQL null type if null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
import synapticloop.h2zero.base.validator.bean.ValidationBean;
4+
import synapticloop.h2zero.base.validator.bean.ValidationFieldBean;
5+
6+
/*
7+
* Copyright (c) 2013-2020 synapticloop.
8+
* All rights reserved.
9+
*
10+
* This source code and any derived binaries are covered by the terms and
11+
* conditions of the Licence agreement ("the Licence"). You may not use this
12+
* source code or any derived binaries except in compliance with the Licence.
13+
* A copy of the Licence is available in the file named LICENCE shipped with
14+
* this source code or binaries.
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* Licence for the specific language governing permissions and limitations
20+
* under the Licence.
21+
*/
22+
23+
24+
public class BinaryValidator extends ValidatorBase {
25+
26+
public BinaryValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
27+
super(nmField, value, minLength, maxLength, allowNull, false);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
21+
public class BoolValidator extends ValidatorBase {
22+
23+
public BoolValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
24+
super(nmField, value, minLength, maxLength, allowNull, false);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
public class CharValidator extends ValidatorBase {
21+
22+
public CharValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
23+
super(nmField, value, minLength, maxLength, allowNull, true);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
public class LongtextValidator extends ValidatorBase {
21+
22+
public LongtextValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
23+
super(nmField, value, minLength, maxLength, allowNull, true);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
import synapticloop.h2zero.base.validator.bean.ValidationBean;
4+
import synapticloop.h2zero.base.validator.bean.ValidationFieldBean;
5+
6+
/*
7+
* Copyright (c) 2013-2020 synapticloop.
8+
* All rights reserved.
9+
*
10+
* This source code and any derived binaries are covered by the terms and
11+
* conditions of the Licence agreement ("the Licence"). You may not use this
12+
* source code or any derived binaries except in compliance with the Licence.
13+
* A copy of the Licence is available in the file named LICENCE shipped with
14+
* this source code or binaries.
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* Licence for the specific language governing permissions and limitations
20+
* under the Licence.
21+
*/
22+
23+
24+
public class MediumblobValidator extends ValidatorBase {
25+
26+
public MediumblobValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
27+
super(nmField, value, minLength, maxLength, allowNull, false);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
import synapticloop.h2zero.base.validator.bean.ValidationBean;
4+
import synapticloop.h2zero.base.validator.bean.ValidationFieldBean;
5+
6+
/*
7+
* Copyright (c) 2013-2020 synapticloop.
8+
* All rights reserved.
9+
*
10+
* This source code and any derived binaries are covered by the terms and
11+
* conditions of the Licence agreement ("the Licence"). You may not use this
12+
* source code or any derived binaries except in compliance with the Licence.
13+
* A copy of the Licence is available in the file named LICENCE shipped with
14+
* this source code or binaries.
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* Licence for the specific language governing permissions and limitations
20+
* under the Licence.
21+
*/
22+
23+
24+
public class MediumintValidator extends ValidatorBase {
25+
26+
public MediumintValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
27+
super(nmField, value, minLength, maxLength, allowNull, false);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
public class MediumtextValidator extends ValidatorBase {
21+
22+
public MediumtextValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
23+
super(nmField, value, minLength, maxLength, allowNull, true);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
import synapticloop.h2zero.base.validator.bean.ValidationBean;
4+
import synapticloop.h2zero.base.validator.bean.ValidationFieldBean;
5+
6+
/*
7+
* Copyright (c) 2013-2020 synapticloop.
8+
* All rights reserved.
9+
*
10+
* This source code and any derived binaries are covered by the terms and
11+
* conditions of the Licence agreement ("the Licence"). You may not use this
12+
* source code or any derived binaries except in compliance with the Licence.
13+
* A copy of the Licence is available in the file named LICENCE shipped with
14+
* this source code or binaries.
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* Licence for the specific language governing permissions and limitations
20+
* under the Licence.
21+
*/
22+
23+
24+
public class TimeValidator extends ValidatorBase {
25+
26+
public TimeValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
27+
super(nmField, value, minLength, maxLength, allowNull, false);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
21+
public class TinyintValidator extends ValidatorBase {
22+
23+
public TinyintValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
24+
super(nmField, value, minLength, maxLength, allowNull, false);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
/*
4+
* Copyright (c) 2013-2020 synapticloop.
5+
* All rights reserved.
6+
*
7+
* This source code and any derived binaries are covered by the terms and
8+
* conditions of the Licence agreement ("the Licence"). You may not use this
9+
* source code or any derived binaries except in compliance with the Licence.
10+
* A copy of the Licence is available in the file named LICENCE shipped with
11+
* this source code or binaries.
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
* Licence for the specific language governing permissions and limitations
17+
* under the Licence.
18+
*/
19+
20+
public class TinytextValidator extends ValidatorBase {
21+
22+
public TinytextValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
23+
super(nmField, value, minLength, maxLength, allowNull, true);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package synapticloop.h2zero.base.validator;
2+
3+
import synapticloop.h2zero.base.validator.bean.ValidationBean;
4+
import synapticloop.h2zero.base.validator.bean.ValidationFieldBean;
5+
6+
/*
7+
* Copyright (c) 2013-2020 synapticloop.
8+
* All rights reserved.
9+
*
10+
* This source code and any derived binaries are covered by the terms and
11+
* conditions of the Licence agreement ("the Licence"). You may not use this
12+
* source code or any derived binaries except in compliance with the Licence.
13+
* A copy of the Licence is available in the file named LICENCE shipped with
14+
* this source code or binaries.
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* Licence for the specific language governing permissions and limitations
20+
* under the Licence.
21+
*/
22+
23+
24+
public class VarbinaryValidator extends ValidatorBase {
25+
26+
public VarbinaryValidator(String nmField, String value, int minLength, int maxLength, boolean allowNull) {
27+
super(nmField, value, minLength, maxLength, allowNull, false);
28+
}
29+
}

0 commit comments

Comments
 (0)