Skip to content

Commit

Permalink
(#117) Fix Qulice's warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rocket-3 committed Nov 7, 2021
1 parent f0e3a55 commit e7fa073
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2018-2021 FusionSoft
*
* 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.
*/

/**
* Classes that helps you build parts of DBD document mappings.
*/
package org.fusionsoft.database.mapping.dbd.built;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2018-2021 FusionSoft
*
* 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 with classes to extract DBD document parts of {@link org.fusionsoft.database.DbdFile}.
*/
package org.fusionsoft.database.mapping.dbd.extracted;
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@
import org.fusionsoft.database.snapshot.objects.filtered.ObjectsWithParentAndType;
import org.fusionsoft.lib.yaml.YamlMappingOfEntries;

/**
* The {@link YamlMappingOfEntries} of DBD/schemas/#schema/domains document node built
* of objects context.
* @since 0.1
*/
public class DbdDomainsMappingOfObjects extends YamlMappingOfEntries {

/**
* Instantiates a new Dbd domains mapping of objects.
* @param objects The whole Objects context to be encapsulated.
* @param schema The parent DbObject to be encapsulated.
*/
public DbdDomainsMappingOfObjects(
final Objects objects,
final DbObject<?> schema
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018-2021 FusionSoft
*
* 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 with classes, that helps in building DBD document parts
* of {@link org.fusionsoft.database.snapshot.Objects}.
*/
package org.fusionsoft.database.mapping.dbd.ofobjects;
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,20 @@
import org.fusionsoft.lib.yaml.MappingWithoutNullScalars;
import org.fusionsoft.lib.yaml.YamlMappingOfEntries;

/**
* The type of {@link DbdDomainConstraintMapping}
* that can be constructed of {@link ResultSet} and {@link Query}.
* @since 0.1
*/
public class DomainConstraintMappingOfResultSet extends DbdDomainConstraintMapping {

/**
* Instantiates a new Domain constraint mapping of result set.
* @param rset The ResultSet to be encapsulated.
* @param query The Query of DbdDomainConstraintFields to be encapsulated.
*/
public DomainConstraintMappingOfResultSet(
final ResultSet rs,
final ResultSet rset,
final Query<DbdDomainConstraintFields> query
) {
super(
Expand All @@ -38,21 +48,21 @@ public DomainConstraintMappingOfResultSet(
DbdDomainConstraintFields.CONSTRAINT,
new TextOfResultSet(
query.outcomeFor(DbdDomainConstraintFields.CONSTRAINT),
rs
rset
)
),
new ScalarEntry(
DbdDomainConstraintFields.VALIDATED,
new TextOfResultSet(
query.outcomeFor(DbdDomainConstraintFields.VALIDATED),
rs
rset
)
),
new MultilineScalarEntry(
DbdDomainConstraintFields.CONDITION,
new TextOfResultSet(
query.outcomeFor(DbdDomainConstraintFields.CONDITION),
rs
rset
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@
* The type of {@link SimpleDbObject} of {@link DbdDomainMapping}
* that can be constructed of {@link ResultSet} and {@link Query} of {@link DbdDomainMapping}.
* @since 0.1
* @checkstyle ClassDataAbstractionCouplingCheck (200 lines)
*/
public class DomainOfResultSet extends SimpleDbObject<DbdDomainMapping> {

/**
* Instantiates a new Domain of result set.
* @param rset The ResultSet to be encapsulated.
* @param connection The Connection to be encapsulated.
* @param query The Query of DbdDomainFields to be encapsulated.
* @param constraints The Func of FullObjectName -> Query of DbdDomainConstraintFields
* to be encapsulated.
* @checkstyle ParameterNumberCheck (100 lines)
*/
public DomainOfResultSet(
final ResultSet rset,
final Connection connection,
Expand All @@ -67,6 +77,16 @@ public DomainOfResultSet(
);
}

/**
* Instantiates a new Domain of result set.
* @param rset The ResultSet to be encapsulated.
* @param connection The Connection to be encapsulated.
* @param query The Query of DbdDomainFields to be encapsulated.
* @param constraints The Func of FullObjectName -> Query of DbdDomainConstraintFields
* to be encapsulated.
* @param domain The FullObjectName of domain to be encapsulated.
* @checkstyle ParameterNumberCheck (100 lines)
*/
private DomainOfResultSet(
final ResultSet rset,
final Connection connection,
Expand All @@ -83,6 +103,15 @@ private DomainOfResultSet(
);
}

/**
* Instantiates a new Domain of result set.
* @param rset The ResultSet to be encapsulated.
* @param connection The Connection to be encapsulated.
* @param query The Query of DbdDomainFields to be encapsulated.
* @param constraints The Query of DbdDomainConstraintFields to be encapsulated.
* @param domain The FullObjectName of domain to be encapsulated.
* @checkstyle ParameterNumberCheck (100 lines)
*/
private DomainOfResultSet(
final ResultSet rset,
final Connection connection,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2018-2021 FusionSoft
*
* 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.
*/

/**
* The package with classes that helps you build
* {@link org.fusionsoft.database.snapshot.Objects} of {@link java.sql.ResultSet},
* {@link org.fusionsoft.database.snapshot.query.Query} and {@link java.sql.Connection}.
*/
package org.fusionsoft.database.snapshot.objects.dbms.resultset;
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@
import org.fusionsoft.database.mapping.fields.DbdDomainConstraintFields;
import org.fusionsoft.database.snapshot.objectsignature.FullObjectName;

/**
* The only type of {@link PgMessageFormatQuery} of {@link DbdDomainConstraintFields}.
* @since 0.1
*/
public class PgDomainConstraintsQuery extends PgMessageFormatQuery<DbdDomainConstraintFields> {

/**
* Instantiates a new Pg domain constraints query.
* @param domain The FullObjectName to be encapsulated.
* @checkstyle StringLiteralsConcatenationCheck (100 lines)
*/
public PgDomainConstraintsQuery(final FullObjectName domain) {
super(
"SELECT \n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@

import org.fusionsoft.database.mapping.fields.DbdDomainFields;

/**
* The only type of {@link PgMessageFormatQuery} of {@link DbdDomainFields}.
* @since 0.1
*/
public class PgDomainsQuery extends PgMessageFormatQuery<DbdDomainFields> {

/**
* Instantiates a new Pg domains query.
* @checkstyle StringLiteralsConcatenationCheck (100 lines)
*/
public PgDomainsQuery() {
super(
"SELECT \n"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018-2021 FusionSoft
*
* 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.
*/

/**
* The package for {@link org.fusionsoft.database.snapshot.query.Query} for
* Postgres DBMS.
*/
package org.fusionsoft.database.snapshot.query.pg;
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@
* See the License for the specific language governing permissions
* and limitations under the License.
*/

package org.fusionsoft.database.snapshot.query.pg;

import org.junit.jupiter.api.Test;

/**
* The tests for {@link PgDomainsQuery}.
* @since 0.1
*/
class PgDomainsQueryTest {
@Test public void show() throws Exception {

/**
* Show.
* @throws Exception When can't.
*/
@Test
@SuppressWarnings("PMD.SystemPrintln")
public void show() throws Exception {
System.out.println(new PgDomainsQuery().asString());
}

Expand Down

0 comments on commit e7fa073

Please sign in to comment.