Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate Changes #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mohitkumarv76
Copy link

No description provided.

Copy link
Member

@kingster kingster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use better variable names across the PR instead of varX.

Also, please check inline comments.

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Duration implements Comparable<Duration> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use-case for this Class?

Comment on lines +32 to +60
while (scanner.hasNext()) {
String next = scanner.next();
if (asl.accept(next)) {
try {
InputStream in = scanner.open();
Throwable var5 = null;

try {
asl.process(next, in);
} catch (Throwable var15) {
var5 = var15;
throw var15;
} finally {
if (in != null) {
if (var5 != null) {
try {
in.close();
} catch (Throwable var14) {
var5.addSuppressed(var14);
}
} else {
in.close();
}
}

}
} catch (IOException var17) {
throw new RuntimeException("AnnotationAcceptingListener failed to process scanned resource: " + next);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this code coming from? If we are coping code, why can't we use that library itself, otherwise lets use the right variable names and give attribution to the sources.

Comment on lines +58 to +65
Iterator var7 = properties.entrySet().iterator();

while (var7.hasNext()) {
Map.Entry<String, String> property = (Map.Entry) var7.next();
configuration.setProperty((String) property.getKey(), (String) property.getValue());
}

this.addAnnotatedClasses(configuration, entities);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here again.

Comment on lines +79 to +84
while (var4.hasNext()) {
Class<?> klass = (Class) var4.next();
configuration.addAnnotatedClass(klass);
entityClasses.add(klass.getCanonicalName());
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Comment on lines +39 to +70
Throwable var2 = null;

try {
Transaction txn = session.beginTransaction();

try {
session.createSQLQuery(this.validationQuery).list();
txn.commit();
} catch (Exception var13) {
if (txn.getStatus().canRollback()) {
txn.rollback();
}

throw var13;
}
} catch (Throwable var14) {
var2 = var14;
throw var14;
} finally {
if (session != null) {
if (var2 != null) {
try {
session.close();
} catch (Throwable var12) {
var2.addSuppressed(var12);
}
} else {
session.close();
}
}

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use better names.

import java.util.Map;

@Provider
public class UnitOfWorkApplicationListener implements ApplicationEventListener {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the usecase of this class? What functionality does it provide?


import java.util.Map;

class UnitOfWorkAspect {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What functionality does this provide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants