CascadeType.ALL does not work with one to mayn relationship
I have two entity, ResultGraph and ResultGraphPoint.ResultGraph has collection of ResultGraphPoints.I am trying to insert ResultGrapt  entity with its ResultGraphPoints. But I get exception that GRAPH_ID can not be null.It is true Graph_ıd can not be null.It ties ResultGraphPoint to related ResultGraph. I have done all things which is adviced in forums. I could not get the point.Graph and GraphPoint client side object to fill ResultGraph and ResultGraphPoint entity fields

Result Graph Entity

@Entity		
@Table (name="RSLT_GRAPH")
public class ResultGraph {
	
	public ResultGraph() {
		super();
	}
	
	@Id
//	@GeneratedValue(strategy=GenerationType.TABLE, generator = "ResultGraphIdGen")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column (name="ID")
	private long id;
	
	@ManyToOne
	@JoinColumn (name= "CONT_SIMULATION_ID")
	private ContingencySimulation contingencySimulation;

	@ManyToOne 
	@JoinColumn(name = "NETWORK_ELEMENT_ID")
	private NetworkElement networkElement;

	@ManyToOne
	@JoinColumn (name= "PARAMETER_TYPE_ID")
	private ParameterType parameterType;

	
	@Column (name= "PARAMETER_DIMENSION")
	private String parameterDimension;
	
	@Column (name= "PARAMETER_PU_BASE")
	private double puBase;
	
	@OneToMany (cascade = {CascadeType.ALL})
	@JoinColumn(name = "GRAPH_ID")
	private Collection<ResultGraphPoint> dataPoints;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}

	
	public String toString() {
		StringBuffer buf = new StringBuffer("ResultGraph => ID:");
		buf.append(getId());
		buf.append(", ");
		buf.append(getParameterType());
		buf.append(", Dimension:");
		buf.append(getParameterDimension());
		buf.append(", pu Base");
		buf.append(getPuBase());
		buf.append("\n\t\t =>");
		buf.append(getNetworkElement());
		buf.append("\n\t\t =>");
		buf.append(getContingencySimulation());
		return buf.toString();
	}
	public NetworkElement getNetworkElement() {
		return networkElement;
	}
	public void setNetworkElement(NetworkElement networkElement) {
		this.networkElement = networkElement;
	}
	public ContingencySimulation getContingencySimulation() {
		return contingencySimulation;
	}
	public void setContingencySimulation(ContingencySimulation contingencySimulation) {
		this.contingencySimulation = contingencySimulation;
	}
	public ParameterType getParameterType() {
		return parameterType;
	}
	public void setParameterType(ParameterType parameterType) {
		this.parameterType = parameterType;
	}
	public String getParameterDimension() {
		return parameterDimension;
	}
	public void setParameterDimension(String parameterDimension) {
		this.parameterDimension = parameterDimension;
	}
	public double getPuBase() {
		return puBase;
	}
	public void setPuBase(double puBase) {
		this.puBase = puBase;
	}
	public Collection<ResultGraphPoint> getDataPoints() {
		return dataPoints;
	}
	public void setDataPoints(Collection<ResultGraphPoint> dataPoints) {
		this.dataPoints = dataPoints;
	}
	}


ResultGraphPointObject

@Entity		
@Table (name="RSLT_GRAPH_POINT")
public class ResultGraphPoint {
	
	public ResultGraphPoint() {
		super();
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column (name="ID")
	private long id;
	
	@ManyToOne
	@JoinColumn (name= "GRAPH_ID")
	private ResultGraph resultGraph;
	
	@Column (name="TIME_INSTANT")
	private int timeInstant;
	
	@Column (name="DATA_VALUE")
	private double value;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public ResultGraph getResultGraph() {
		return resultGraph;
	}

	public void setResultGraph(ResultGraph resultGraph) {
		this.resultGraph = resultGraph;
	}

	public int getTimeInstant() {
		return timeInstant;
	}

	public void setTimeInstant(int timeInstant) {
		this.timeInstant = timeInstant;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}
	
	public String toString() {
		StringBuffer buf = new StringBuffer("GraphDataPoint ID:");
		buf.append(getId());
		buf.append(", Graph ID:");
		buf.append(getResultGraph().getId());
		buf.append(", TimeInstant:");
		buf.append(getTimeInstant());
		buf.append(", Value:");
		buf.append(getValue());
		return buf.toString();
	}
}
  EJB sessian bean to insert entity
	public void addEntitiesToDatabase(List<?> entityList,
			InsertedEntityType type) {

		ResultElementIndexService elementIndexService = null;
		ResultGraphService resultGraphService = null;
		ContingencySimulationService contingencySimulationService = new ContingencySimulationService(em);
		ContingencySimulation  contingencySimulation = contingencySimulationService.find((long)1);
		NetworkElementService neService = new NetworkElementService(em);
		ParameterTypeService parameterTypeService = new ParameterTypeService(em);

	if(type.equals(InsertedEntityType.RESULT_GRAPH))
		{
			resultGraphService = new ResultGraphService(em);
			
			for(int graphList = 0; graphList < entityList.size() ; graphList ++)
			{
				NetworkElement networkElementObject = null;
				String parameterName = ((Graph)entityList.get(graphList)).getParameterTypeId();
				ParameterType parameterTypeObject  = parameterTypeService.find((long)getParameterIdFromParameterName(parameterName));
				List <NetworkElement>  networkElementList = neService.findByName(1, ((Graph)entityList.get(graphList)).getNetworkElementId());
				for (NetworkElement networkElement : networkElementList) {
					if(networkElement.getName().equals(((Graph)entityList.get(graphList)).getNetworkElementId()))
					{
						networkElementObject = networkElement;
					}
				}
				List <ResultGraphPoint> graphPoints = new ArrayList <ResultGraphPoint>();
				ResultGraph resultGraphObject = new ResultGraph();
				resultGraphObject.setContingencySimulation(contingencySimulation);
				resultGraphObject.setNetworkElement(networkElementObject);
				resultGraphObject.setParameterType(parameterTypeObject);
				resultGraphObject.setParameterDimension("kw");
				resultGraphObject.setPuBase(0.0);
				graphPoints = mapGraphPointsDatabaseEntity(resultGraphObject,((Graph)entityList.get(graphList)).getGraphPoint());
				resultGraphObject.setDataPoints(graphPoints);
				resultGraphService.create(resultGraphObject);
			}
		}
			
	}
CascadeType.ALL does not work with one to mayn relationship
===

I have two entity, ResultGraph and ResultGraphPoint.ResultGraph has collection of ResultGraphPoints.I am trying to insert ResultGrapt  entity with its ResultGraphPoints. But I get exception that GRAPH_ID can not be null.It is true Graph_ıd can not be null.It ties ResultGraphPoint to related ResultGraph. I have done all things which is adviced in forums. I could not get the point.Graph and GraphPoint client side object to fill ResultGraph and ResultGraphPoint entity fields

Result Graph Entity

@Entity		
@Table (name="RSLT_GRAPH")
public class ResultGraph {
	
	public ResultGraph() {
		super();
	}
	
	@Id
//	@GeneratedValue(strategy=GenerationType.TABLE, generator = "ResultGraphIdGen")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column (name="ID")
	private long id;
	
	@ManyToOne
	@JoinColumn (name= "CONT_SIMULATION_ID")
	private ContingencySimulation contingencySimulation;

	@ManyToOne 
	@JoinColumn(name = "NETWORK_ELEMENT_ID")
	private NetworkElement networkElement;

	@ManyToOne
	@JoinColumn (name= "PARAMETER_TYPE_ID")
	private ParameterType parameterType;

	
	@Column (name= "PARAMETER_DIMENSION")
	private String parameterDimension;
	
	@Column (name= "PARAMETER_PU_BASE")
	private double puBase;
	
	@OneToMany (cascade = {CascadeType.ALL})
	@JoinColumn(name = "GRAPH_ID")
	private Collection<ResultGraphPoint> dataPoints;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}

	
	public String toString() {
		StringBuffer buf = new StringBuffer("ResultGraph => ID:");
		buf.append(getId());
		buf.append(", ");
		buf.append(getParameterType());
		buf.append(", Dimension:");
		buf.append(getParameterDimension());
		buf.append(", pu Base");
		buf.append(getPuBase());
		buf.append("\n\t\t =>");
		buf.append(getNetworkElement());
		buf.append("\n\t\t =>");
		buf.append(getContingencySimulation());
		return buf.toString();
	}
	public NetworkElement getNetworkElement() {
		return networkElement;
	}
	public void setNetworkElement(NetworkElement networkElement) {
		this.networkElement = networkElement;
	}
	public ContingencySimulation getContingencySimulation() {
		return contingencySimulation;
	}
	public void setContingencySimulation(ContingencySimulation contingencySimulation) {
		this.contingencySimulation = contingencySimulation;
	}
	public ParameterType getParameterType() {
		return parameterType;
	}
	public void setParameterType(ParameterType parameterType) {
		this.parameterType = parameterType;
	}
	public String getParameterDimension() {
		return parameterDimension;
	}
	public void setParameterDimension(String parameterDimension) {
		this.parameterDimension = parameterDimension;
	}
	public double getPuBase() {
		return puBase;
	}
	public void setPuBase(double puBase) {
		this.puBase = puBase;
	}
	public Collection<ResultGraphPoint> getDataPoints() {
		return dataPoints;
	}
	public void setDataPoints(Collection<ResultGraphPoint> dataPoints) {
		this.dataPoints = dataPoints;
	}
	}


ResultGraphPointObject

@Entity		
@Table (name="RSLT_GRAPH_POINT")
public class ResultGraphPoint {
	
	public ResultGraphPoint() {
		super();
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column (name="ID")
	private long id;
	
	@ManyToOne
	@JoinColumn (name= "GRAPH_ID")
	private ResultGraph resultGraph;
	
	@Column (name="TIME_INSTANT")
	private int timeInstant;
	
	@Column (name="DATA_VALUE")
	private double value;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public ResultGraph getResultGraph() {
		return resultGraph;
	}

	public void setResultGraph(ResultGraph resultGraph) {
		this.resultGraph = resultGraph;
	}

	public int getTimeInstant() {
		return timeInstant;
	}

	public void setTimeInstant(int timeInstant) {
		this.timeInstant = timeInstant;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}
	
	public String toString() {
		StringBuffer buf = new StringBuffer("GraphDataPoint ID:");
		buf.append(getId());
		buf.append(", Graph ID:");
		buf.append(getResultGraph().getId());
		buf.append(", TimeInstant:");
		buf.append(getTimeInstant());
		buf.append(", Value:");
		buf.append(getValue());
		return buf.toString();
	}
}
  EJB sessian bean to insert entity
	public void addEntitiesToDatabase(List<?> entityList,
			InsertedEntityType type) {

		ResultElementIndexService elementIndexService = null;
		ResultGraphService resultGraphService = null;
		ContingencySimulationService contingencySimulationService = new ContingencySimulationService(em);
		ContingencySimulation  contingencySimulation = contingencySimulationService.find((long)1);
		NetworkElementService neService = new NetworkElementService(em);
		ParameterTypeService parameterTypeService = new ParameterTypeService(em);

	if(type.equals(InsertedEntityType.RESULT_GRAPH))
		{
			resultGraphService = new ResultGraphService(em);
			
			for(int graphList = 0; graphList < entityList.size() ; graphList ++)
			{
				NetworkElement networkElementObject = null;
				String parameterName = ((Graph)entityList.get(graphList)).getParameterTypeId();
				ParameterType parameterTypeObject  = parameterTypeService.find((long)getParameterIdFromParameterName(parameterName));
				List <NetworkElement>  networkElementList = neService.findByName(1, ((Graph)entityList.get(graphList)).getNetworkElementId());
				for (NetworkElement networkElement : networkElementList) {
					if(networkElement.getName().equals(((Graph)entityList.get(graphList)).getNetworkElementId()))
					{
						networkElementObject = networkElement;
					}
				}
				List <ResultGraphPoint> graphPoints = new ArrayList <ResultGraphPoint>();
				ResultGraph resultGraphObject = new ResultGraph();
				resultGraphObject.setContingencySimulation(contingencySimulation);
				resultGraphObject.setNetworkElement(networkElementObject);
				resultGraphObject.setParameterType(parameterTypeObject);
				resultGraphObject.setParameterDimension("kw");
				resultGraphObject.setPuBase(0.0);
				graphPoints = mapGraphPointsDatabaseEntity(resultGraphObject,((Graph)entityList.get(graphList)).getGraphPoint());
				resultGraphObject.setDataPoints(graphPoints);
				resultGraphService.create(resultGraphObject);
			}
		}
			
	}