What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?

I know Scope_Identity(), Identity(), @@Identity, and Ident_Current() all get the value of the identity column, but I would love to know the difference. Part of the controversy I’m having is what do they mean by scope as applied to these functions above? I would also love a simple example of different scenarios of using them? … Read more

ASP.NET MVC 5 – Identity. How to get current ApplicationUser

I have an Article entity in my project which has the ApplicationUser property named Author. How can I get the full object of currently logged ApplicationUser? While creating a new article, I have to set the Author property in Article to the current ApplicationUser. In the old Membership mechanism it was simple, but in the … Read more

How to get the unique ID of an object which overrides hashCode()?

When a class in Java doesn’t override hashCode(), printing an instance of this class gives a nice unique number. The Javadoc of Object says about hashCode(): As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. But when the class overrides hashCode(), how can I … Read more

The JPA hashCode() / equals() dilemma

There have been some discussions here about JPA entities and which hashCode()/equals() implementation should be used for JPA entity classes. Most (if not all) of them depend on Hibernate, but I’d like to discuss them JPA-implementation-neutrally (I am using EclipseLink, by the way). All possible implementations are having their own advantages and disadvantages regarding: hashCode()/equals() … Read more

What is the difference between == and equals() in Java?

I wanted to clarify if I understand this correctly: == is a reference comparison, i.e. both objects point to the same memory location .equals() evaluates to the comparison of values in the objects 25 s 25 In general, the answer to your question is “yes”, but… .equals(…) will only compare what it is written to … Read more