How to check if object is null or not except == null

The easiest way to check is entity == null. There is no shorter way to do that. Note that there is a method for this in the standard lib: Objects.isNull(Object obj) And another one which is the opposite of the above one: Objects.nonNull(Object obj) And there is yet another one which can be used to force … Read more

hibernate properties not found

I guess the problem is with the code for configuration you mentioned for .hbm.xml may not be working in Tomcat. I think it needs AnnotationConfiguration object. I guess you used this code due to the Annotationconfiguration object creation is not working. Better create a maven hibernate project with pom and export the war file to Tomcat (with the changes of Annotationconfiguration). Also use log4j … Read more

Java: Unresolved compilation problem

(rewritten 2015-07-28) The default behavior of Eclipse when compiling code with errors in it, is to generate byte code throwing the exception you see, allowing the program to be run. This is possible as Eclipse uses its own built-in compiler, instead of javac from the JDK which Apache Maven uses, and which fails the compilation completely for … Read more

Error: Generic Array Creation

You can’t create arrays with a generic component type. Create an array of an explicit type, like Object[], instead. You can then cast this to PCB[] if you want, but I don’t recommend it in most cases. If you want type safety, use a collection like java.util.List<PCB> instead of an array. By the way, if list is already a java.util.List, you should use … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)