Skip to content

Commit 99d5a5a

Browse files
fix all the checkstyle violations (iluwatar#79)
1 parent 29ed0f9 commit 99d5a5a

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

active-record/src/main/java/com/iluwatar/activerecord/App.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import lombok.extern.slf4j.Slf4j;
66
import org.h2.jdbcx.JdbcDataSource;
77

8+
/**
9+
* The amin application for the manual testing purposes.
10+
*/
811
@Slf4j
912
public class App {
1013

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

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

51-
// customer.addOrder(order);
59+
// customer.addOrder(order);
5260
customer.save();
5361

5462
LOGGER.info("The customer data by ID={}", customer.findById(1L));

active-record/src/main/java/com/iluwatar/activerecord/Customer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import lombok.Setter;
99
import lombok.ToString;
1010

11+
/**
12+
* The customer domain model.
13+
*/
1114
@Getter
1215
@Setter
1316
@ToString

active-record/src/main/java/com/iluwatar/activerecord/Order.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import lombok.NoArgsConstructor;
77
import lombok.Setter;
88

9+
/**
10+
* An order domain model.
11+
*/
912
@Getter
1013
@Setter
1114
@EqualsAndHashCode(onlyExplicitlyIncluded = true)

active-record/src/main/java/com/iluwatar/activerecord/RecordBase.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
import lombok.RequiredArgsConstructor;
1212
import lombok.Setter;
1313

14+
/**
15+
* An active record base supposed to hold all the necessary active record pattern logic.
16+
*
17+
* @param <T> an active record type.
18+
*/
1419
@RequiredArgsConstructor
1520
public abstract class RecordBase<T extends RecordBase<?>> {
1621

@@ -117,8 +122,10 @@ private String constructFindByIdQuery() {
117122
private T getDeclaredClassInstance() {
118123
try {
119124
return clazz.getDeclaredConstructor().newInstance();
120-
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException |
121-
InstantiationException e) {
125+
} catch (InvocationTargetException
126+
| NoSuchMethodException
127+
| IllegalAccessException
128+
| InstantiationException e) {
122129
throw new IllegalStateException(
123130
"Unable to create a new instance of the class=" + clazz.getName(), e);
124131
}

0 commit comments

Comments
 (0)