I am writing a JPA code wherein I try to read/write some entities in my database through JPA. One funny thing that I came across was when I am reading an entity for the first time( the entity record is inserted at the backend), JPA throws exception as "Entity name ABC not recognized as a known entity. Perhaps you meant XYZ. Known entity names [XYZ].
Now the difference between ABC and XYZ is that XYZ was inserted through JPA and then read.
When I do the same thing with ABC, it starts recognizing it, which means all the JPA configurations with respect to ABC are correct. Any ideas?
Also Hibernate for example has its own @Entity annotation and I have seen people inadvertently use it instead of the one coming out of javax.persistence. Having the wrong import will also cause issues.