Field 'id' doesn't have a default value

I want to write a CDT parent with CDT child (nested) in database. I have activated foreign key and it still shows me the following error message:

 

An error occurred while trying to write to the entity "provider" [id = 48335b48-1597-4c79-bc45-5562b8684918 @ 45646, type = DEMO_CDT_Data_Provider 
(id = 6072)] (data store: CDT_PROVEEDOR_BBDD). Details: org.hibernate.exception.GenericJDBCException: could not insert: [GLBDT6313Address]:
java.sql.SQLException: Field 'id' does not have a default value Data: TypedValue [it = 6072, v = {<null>, 11111111D, 11111111D ,,,,,,,,,, <null> ,,,
11111111D, 11111111D ,, {Bank, sa22}, {Billing, street, 321.22233, mad, New York, USA, 2wqea ,, <null >}, <null>, <null>}]

 

 

any ideas?

  Discussion posts and replies are publicly visible

Parents
  • Hi carlosa670,
    Can you share your both CDT?

    Thanks and Regards,
    Amit Behere
  • Hi amitb0004,

    This is the father's XSD:

    <xsd:schema xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:glb2="urn:com:appian:types:GLB" xmlns:n1="urn:com:appian:types:GLB" xmlns:tns="urn:com:appian:Datos_Proveedor" targetNamespace="urn:com:appian:Datos_Proveedor">
    <xsd:import namespace="urn:com:appian:types:GLB" schemaLocation="%7Burn%3Acom%3Aappian%3Atypes%3AGLB%7DGLB_Datos_Banco.xsd" />
    <xsd:import namespace="urn:com:appian:types:GLB" schemaLocation="%7Burn%3Acom%3Aappian%3Atypes%3AGLB%7DGLB_Direccion.xsd" />
    <xsd:complexType name="DEMO_CDT_Datos_Proveedor">
    <xsd:annotation>
    <xsd:documentation><![CDATA[cdt de datos del proveedor con tipo de datos correcto]]></xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="CIF" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="nombre" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="sector" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="subsector" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="cuentaCliente" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="razonSocial" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="moneda" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="tipoImpuestos" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="tipoCompania" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="estado" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="logo" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="imagen" nillable="true" type="xsd:int" />
    <xsd:element name="web" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="comentarios" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="telefono" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="correoElectronico" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="urlMostrar" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element form="unqualified" name="datosBanco" nillable="true" type="n1:GLB_Datos_Banco">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@OneToOne(cascade=CascadeType.ALL)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element form="unqualified" name="direccion" nillable="true" type="n1:GLB_Direccion">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@OneToOne(cascade=CascadeType.ALL)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>


    And this is the child:
    <xsd:schema xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:tns="urn:com:appian:types:GLB" targetNamespace="urn:com:appian:types:GLB">
    <xsd:complexType name="GLB_Direccion">
    <xsd:annotation>
    <xsd:documentation><![CDATA[CDT que almacena datos de una dirección]]></xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="tipoDireccion" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="direccion" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="numero" nillable="true" type="xsd:int" />
    <xsd:element name="codigoPostal" nillable="true" type="xsd:int" />
    <xsd:element name="localidad" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="provincia" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="pais" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="comentarios" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="personaContacto" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
  • The problem is in form="unqualified" name="direccion" nillable="true" type="n1:GLB_Direccion" in father's CDT.

    Thanks for your answer
Reply Children
No Data