Skip to content

Commit

Permalink
fix all the checkstyle violations (iluwatar#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejsvisockis committed Apr 15, 2024
1 parent 29ed0f9 commit 99d5a5a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
12 changes: 10 additions & 2 deletions active-record/src/main/java/com/iluwatar/activerecord/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import lombok.extern.slf4j.Slf4j;
import org.h2.jdbcx.JdbcDataSource;

/**
* The amin application for the manual testing purposes.
*/
@Slf4j
public class App {

Expand All @@ -28,7 +31,12 @@ public class App {
+ " CONSTRAINT customer_id_fk FOREIGN KEY (customer_id) REFERENCES customer (id)\n"
+ ")";


/**
* Java main method to execute all the logic out there.
*
* @param args arguments.
* @throws Exception Any sort of exception that have to be picked up by the JVM.
*/
public static void main(final String[] args) throws Exception {
final var dataSource = createDataSource();
createSchema(dataSource);
Expand All @@ -48,7 +56,7 @@ private static void executeOperation() {
order.setId(1L);
order.setOrderNumber("O123");

// customer.addOrder(order);
// customer.addOrder(order);
customer.save();

LOGGER.info("The customer data by ID={}", customer.findById(1L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import lombok.Setter;
import lombok.ToString;

/**
* The customer domain model.
*/
@Getter
@Setter
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
* An order domain model.
*/
@Getter
@Setter
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/**
* An active record base supposed to hold all the necessary active record pattern logic.
*
* @param <T> an active record type.
*/
@RequiredArgsConstructor
public abstract class RecordBase<T extends RecordBase<?>> {

Expand Down Expand Up @@ -117,8 +122,10 @@ private String constructFindByIdQuery() {
private T getDeclaredClassInstance() {
try {
return clazz.getDeclaredConstructor().newInstance();
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException |
InstantiationException e) {
} catch (InvocationTargetException
| NoSuchMethodException
| IllegalAccessException
| InstantiationException e) {
throw new IllegalStateException(
"Unable to create a new instance of the class=" + clazz.getName(), e);
}
Expand Down

0 comments on commit 99d5a5a

Please sign in to comment.