CREATE TABLE `voyage_master` (
`VOYAGE_ID` int(10) unsigned NOT NULL auto_increment,
`VOYAGE_NUMBER` varchar(5) NOT NULL,
`VESSEL_ID` int(10) unsigned NOT NULL,
KEY `FK_VYG_MST_VESSEL` (`VESSEL_ID`),
KEY `FK_VYG_MST_ROUTE` (`ROUTE_ID`),
CONSTRAINT `FK_VYG_MST_ROUTE` FOREIGN KEY (`ROUTE_ID`) REFERENCES `vsl_route` (`ROUTE_ID`),
CONSTRAINT `FK_VYG_MST_VESSEL` FOREIGN KEY (`VESSEL_ID`) REFERENCES `vessel` (`VESSEL_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Maintains Voyage Master Info';
This is my table
In the seam Generated entites i wanted to put a search on 'vessel id' which is the foreign key
The Input text value is
<s:decorate template="layout/display.xhtml">
<ui:define name="label">VesselID</ui:define>
<h:inputText id="vesselName"
value="#{voyageMasterList.voyageMaster.vessel.vesselId}" />
and made changes accordling the RESTRICTION() of List.java
when i try to search i am getting exception
Exception during request processing:
Caused by javax.servlet.ServletException with message: "/VoyageMasterList.xhtml @27,67 value="#{voyageMasterList.voyageMaster.vessel.vesselId}": Target Unreachable, 'vessel' returned null on 'com.infyz.toms.entity.VoyageMaster'"
How should i solve this problem?
</s:decorate>