need help in findByPrimaryKey
i have a problem
when ever i try to map 1:1 relationship at that time when at client side when i call the primary key of other table then the following error occurs
non-static method findByPrimaryKey(java.lang.String) cannot be referenced from a static context
now can any one tell me why this occurs
i shall be thankful to you
This is not a "mapping" issue - it is a coding issue.
The error message is telling you that the method you are trying to call must be called by and within an instance of the class, rather than from the "class" itself. A static method can be called from "the class" - like many Math class methods, such as calling Math.pow( 2.3, 4.0). A non-static method must be called from an instance of a class - such as myString.toUpperCase( littlestring ).
The method you are calling is non-static, and you are trying to invoke it by calling Class.method rather than instanceOfClass.method.
By Jared Dinerstein in forum Java
Last Post: 08-29-2002, 03:28 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL