-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: master
Are you sure you want to change the base?
Hibernate Changes #115
Conversation
There was a problem hiding this 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> { |
There was a problem hiding this comment.
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?
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); | ||
} |
There was a problem hiding this comment.
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.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here again.
while (var4.hasNext()) { | ||
Class<?> klass = (Class) var4.next(); | ||
configuration.addAnnotatedClass(klass); | ||
entityClasses.add(klass.getCanonicalName()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
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(); | ||
} | ||
} | ||
|
||
} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
No description provided.