Deleting a table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Deleting a table

Edward Banfa-2
Hi all.

 

I would like to know how to delete a table in the Derby database that comes
with Ofbiz.

 

Actually I have a problem with a an entity that I created, I want to alter
the columns on the entity and hence in the underlying table that represents
the data for the entity. Do I have to drop the existing table or is there a
way I can have ofbiz pickup any changes in the

entity definition and update the db schema ?

 

Thank u for ur help in advance

 

Regards

 

Edward

Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

Scott Gray
OFBiz will add columns for you but won't delete or update columns.  In the
WebTools app you can run raw sql against the database to make the necessary
changes.

Regards
Scott

On 17/12/2007, Edward Banfa <[hidden email]> wrote:

>
> Hi all.
>
>
>
> I would like to know how to delete a table in the Derby database that
> comes
> with Ofbiz.
>
>
>
> Actually I have a problem with a an entity that I created, I want to alter
> the columns on the entity and hence in the underlying table that
> represents
> the data for the entity. Do I have to drop the existing table or is there
> a
> way I can have ofbiz pickup any changes in the
>
> entity definition and update the db schema ?
>
>
>
> Thank u for ur help in advance
>
>
>
> Regards
>
>
>
> Edward
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

Jacques Le Roux
Administrator
In reply to this post by Edward Banfa-2
http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo

Look for Derby, not sure there is exactly an answer but you should find your way from there. Beware that it's not recommended to
delete tables in OFBiz...

Jacques

De : "Edward Banfa" <[hidden email]>

> Hi all.
>
>
>
> I would like to know how to delete a table in the Derby database that comes
> with Ofbiz.
>
>
>
> Actually I have a problem with a an entity that I created, I want to alter
> the columns on the entity and hence in the underlying table that represents
> the data for the entity. Do I have to drop the existing table or is there a
> way I can have ofbiz pickup any changes in the
>
> entity definition and update the db schema ?
>
>
>
> Thank u for ur help in advance
>
>
>
> Regards
>
>
>
> Edward
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Deleting a table

Edward Banfa-2

Hi Jacques,

Ummm, what are the implications of deleting a table in ofbiz apart from loss
of data contained in that table? Coz I just deleted a table using the SQL
processor (am actually just learning Ofbiz, am not yet working on a building
a production app). I had previously defined an entity called Patient and
after a I deleted the table and I restarted ofbiz, I cant see my entity in
the Entity Data Maintenance page of webtools. Issuing the following SQL
"SELECT * FROM PATIENT" from the SQL processor page throws an exception, the
trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not exist.

Am I missing something here?

All help appreciated, thx

Regards

Edward

Below are my entitymodel.xml and entitygroup.xml files repectively

--------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
  <!-- ========================================================= -->
  <!-- ======================== Defaults ======================= -->
  <!-- ========================================================= -->
    <title>Entities for a Hello world component</title>
    <description>None</description>
    <copyright>Copyright (c) Hello World, Inc.</copyright>
    <author>Edward Banfa</author>
    <version>0.1</version>

    <entity entity-name="Patient" package-name="org.helloworld.emedic"
        title="Entity to represent mentally sick people in government">
        <field name="patientId" type="id-ne"/>
        <field name="firstName" type="id"/>
        <field name="lastName" type="id"/>
        <field name="appointment" type="id"/>
        <prim-key field="patientId"/>      
    </entity>
   
</entitymodel>
-------------------------------------------------------------------------

-------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">


  <entity-group group="org.ofbiz" entity="Patient"/>

</entitygroup>

--------------------------------------------------------------------------












-----Original Message-----
From: Jacques Le Roux [mailto:[hidden email]]
Sent: Monday, December 17, 2007 11:56 AM
To: [hidden email]
Subject: Re: Deleting a table

http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo

Look for Derby, not sure there is exactly an answer but you should find your
way from there. Beware that it's not recommended to
delete tables in OFBiz...

Jacques

De : "Edward Banfa" <[hidden email]>
> Hi all.
>
>
>
> I would like to know how to delete a table in the Derby database that
comes
> with Ofbiz.
>
>
>
> Actually I have a problem with a an entity that I created, I want to alter
> the columns on the entity and hence in the underlying table that
represents
> the data for the entity. Do I have to drop the existing table or is there
a

> way I can have ofbiz pickup any changes in the
>
> entity definition and update the db schema ?
>
>
>
> Thank u for ur help in advance
>
>
>
> Regards
>
>
>
> Edward
>
>






Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

BJ Freeman
like any relational database, if you have tables that are realated and
they have data in them then that data may be lost.

as a side note: look at using a party as person and create a Patient
Party group. saves doing redundant work


Edward Banfa sent the following on 12/17/2007 3:50 AM:

> Hi Jacques,
>
> Ummm, what are the implications of deleting a table in ofbiz apart from loss
> of data contained in that table? Coz I just deleted a table using the SQL
> processor (am actually just learning Ofbiz, am not yet working on a building
> a production app). I had previously defined an entity called Patient and
> after a I deleted the table and I restarted ofbiz, I cant see my entity in
> the Entity Data Maintenance page of webtools. Issuing the following SQL
> "SELECT * FROM PATIENT" from the SQL processor page throws an exception, the
> trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not exist.
>
> Am I missing something here?
>
> All help appreciated, thx
>
> Regards
>
> Edward
>
> Below are my entitymodel.xml and entitygroup.xml files repectively
>
> --------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
>   <!-- ========================================================= -->
>   <!-- ======================== Defaults ======================= -->
>   <!-- ========================================================= -->
>     <title>Entities for a Hello world component</title>
>     <description>None</description>
>     <copyright>Copyright (c) Hello World, Inc.</copyright>
>     <author>Edward Banfa</author>
>     <version>0.1</version>
>
>     <entity entity-name="Patient" package-name="org.helloworld.emedic"
>         title="Entity to represent mentally sick people in government">
>         <field name="patientId" type="id-ne"/>
>         <field name="firstName" type="id"/>
>         <field name="lastName" type="id"/>
>         <field name="appointment" type="id"/>
>         <prim-key field="patientId"/>      
>     </entity>
>    
> </entitymodel>
> -------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>
>
>   <entity-group group="org.ofbiz" entity="Patient"/>
>
> </entitygroup>
>
> --------------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:[hidden email]]
> Sent: Monday, December 17, 2007 11:56 AM
> To: [hidden email]
> Subject: Re: Deleting a table
>
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>
> Look for Derby, not sure there is exactly an answer but you should find your
> way from there. Beware that it's not recommended to
> delete tables in OFBiz...
>
> Jacques
>
> De : "Edward Banfa" <[hidden email]>
>> Hi all.
>>
>>
>>
>> I would like to know how to delete a table in the Derby database that
> comes
>> with Ofbiz.
>>
>>
>>
>> Actually I have a problem with a an entity that I created, I want to alter
>> the columns on the entity and hence in the underlying table that
> represents
>> the data for the entity. Do I have to drop the existing table or is there
> a
>> way I can have ofbiz pickup any changes in the
>>
>> entity definition and update the db schema ?
>>
>>
>>
>> Thank u for ur help in advance
>>
>>
>>
>> Regards
>>
>>
>>
>> Edward
>>
>>
>
>
>
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

Adrian Crum
Maybe a Patient party role would be more appropriate.


BJ Freeman wrote:

> like any relational database, if you have tables that are realated and
> they have data in them then that data may be lost.
>
> as a side note: look at using a party as person and create a Patient
> Party group. saves doing redundant work
>
>
> Edward Banfa sent the following on 12/17/2007 3:50 AM:
>
>>Hi Jacques,
>>
>>Ummm, what are the implications of deleting a table in ofbiz apart from loss
>>of data contained in that table? Coz I just deleted a table using the SQL
>>processor (am actually just learning Ofbiz, am not yet working on a building
>>a production app). I had previously defined an entity called Patient and
>>after a I deleted the table and I restarted ofbiz, I cant see my entity in
>>the Entity Data Maintenance page of webtools. Issuing the following SQL
>>"SELECT * FROM PATIENT" from the SQL processor page throws an exception, the
>>trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not exist.
>>
>>Am I missing something here?
>>
>>All help appreciated, thx
>>
>>Regards
>>
>>Edward
>>
>>Below are my entitymodel.xml and entitygroup.xml files repectively
>>
>>--------------------------------------------------------
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>>xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
>>  <!-- ========================================================= -->
>>  <!-- ======================== Defaults ======================= -->
>>  <!-- ========================================================= -->
>>    <title>Entities for a Hello world component</title>
>>    <description>None</description>
>>    <copyright>Copyright (c) Hello World, Inc.</copyright>
>>    <author>Edward Banfa</author>
>>    <version>0.1</version>
>>
>>    <entity entity-name="Patient" package-name="org.helloworld.emedic"
>>        title="Entity to represent mentally sick people in government">
>>        <field name="patientId" type="id-ne"/>
>>        <field name="firstName" type="id"/>
>>        <field name="lastName" type="id"/>
>>        <field name="appointment" type="id"/>
>>        <prim-key field="patientId"/>      
>>    </entity>
>>  
>></entitymodel>
>>-------------------------------------------------------------------------
>>
>>-------------------------------------------------------------------------
>>
>><?xml version="1.0" encoding="UTF-8"?>
>>
>><entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>>xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>>
>>
>>  <entity-group group="org.ofbiz" entity="Patient"/>
>>
>></entitygroup>
>>
>>--------------------------------------------------------------------------
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>-----Original Message-----
>>From: Jacques Le Roux [mailto:[hidden email]]
>>Sent: Monday, December 17, 2007 11:56 AM
>>To: [hidden email]
>>Subject: Re: Deleting a table
>>
>>http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>
>>Look for Derby, not sure there is exactly an answer but you should find your
>>way from there. Beware that it's not recommended to
>>delete tables in OFBiz...
>>
>>Jacques
>>
>>De : "Edward Banfa" <[hidden email]>
>>
>>>Hi all.
>>>
>>>
>>>
>>>I would like to know how to delete a table in the Derby database that
>>
>>comes
>>
>>>with Ofbiz.
>>>
>>>
>>>
>>>Actually I have a problem with a an entity that I created, I want to alter
>>>the columns on the entity and hence in the underlying table that
>>
>>represents
>>
>>>the data for the entity. Do I have to drop the existing table or is there
>>
>>a
>>
>>>way I can have ofbiz pickup any changes in the
>>>
>>>entity definition and update the db schema ?
>>>
>>>
>>>
>>>Thank u for ur help in advance
>>>
>>>
>>>
>>>Regards
>>>
>>>
>>>
>>>Edward
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

BJ Freeman
I have not seen much code using the party role, though that is a good way.

Adrian Crum sent the following on 12/17/2007 8:23 AM:

> Maybe a Patient party role would be more appropriate.
>
>
> BJ Freeman wrote:
>
>> like any relational database, if you have tables that are realated and
>> they have data in them then that data may be lost.
>>
>> as a side note: look at using a party as person and create a Patient
>> Party group. saves doing redundant work
>>
>>
>> Edward Banfa sent the following on 12/17/2007 3:50 AM:
>>
>>> Hi Jacques,
>>>
>>> Ummm, what are the implications of deleting a table in ofbiz apart
>>> from loss
>>> of data contained in that table? Coz I just deleted a table using the
>>> SQL
>>> processor (am actually just learning Ofbiz, am not yet working on a
>>> building
>>> a production app). I had previously defined an entity called Patient and
>>> after a I deleted the table and I restarted ofbiz, I cant see my
>>> entity in
>>> the Entity Data Maintenance page of webtools. Issuing the following
>>> SQL "SELECT * FROM PATIENT" from the SQL processor page throws an
>>> exception, the
>>> trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not
>>> exist.
>>>
>>> Am I missing something here?
>>>
>>> All help appreciated, thx
>>>
>>> Regards
>>>
>>> Edward
>>>
>>> Below are my entitymodel.xml and entitygroup.xml files repectively
>>>
>>> --------------------------------------------------------
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
>>>
>>>  <!-- ========================================================= -->
>>>  <!-- ======================== Defaults ======================= -->
>>>  <!-- ========================================================= -->
>>>    <title>Entities for a Hello world component</title>
>>>    <description>None</description>
>>>    <copyright>Copyright (c) Hello World, Inc.</copyright>
>>>    <author>Edward Banfa</author>
>>>    <version>0.1</version>
>>>
>>>    <entity entity-name="Patient" package-name="org.helloworld.emedic"
>>>        title="Entity to represent mentally sick people in government">
>>>        <field name="patientId" type="id-ne"/>
>>>        <field name="firstName" type="id"/>
>>>        <field name="lastName" type="id"/>
>>>        <field name="appointment" type="id"/>
>>>        <prim-key field="patientId"/>         </entity>
>>>   </entitymodel>
>>> -------------------------------------------------------------------------
>>>
>>>
>>> -------------------------------------------------------------------------
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>>>
>>>
>>>
>>>  <entity-group group="org.ofbiz" entity="Patient"/>
>>>
>>> </entitygroup>
>>>
>>> --------------------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jacques Le Roux [mailto:[hidden email]] Sent:
>>> Monday, December 17, 2007 11:56 AM
>>> To: [hidden email]
>>> Subject: Re: Deleting a table
>>>
>>> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>
>>>
>>> Look for Derby, not sure there is exactly an answer but you should
>>> find your
>>> way from there. Beware that it's not recommended to
>>> delete tables in OFBiz...
>>>
>>> Jacques
>>>
>>> De : "Edward Banfa" <[hidden email]>
>>>
>>>> Hi all.
>>>>
>>>>
>>>>
>>>> I would like to know how to delete a table in the Derby database that
>>>
>>> comes
>>>
>>>> with Ofbiz.
>>>>
>>>>
>>>>
>>>> Actually I have a problem with a an entity that I created, I want to
>>>> alter
>>>> the columns on the entity and hence in the underlying table that
>>>
>>> represents
>>>
>>>> the data for the entity. Do I have to drop the existing table or is
>>>> there
>>>
>>> a
>>>
>>>> way I can have ofbiz pickup any changes in the
>>>>
>>>> entity definition and update the db schema ?
>>>>
>>>>
>>>>
>>>> Thank u for ur help in advance
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>>
>>>>
>>>> Edward
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Deleting a table

Edward Banfa-2
Hi all,
Someone please correct me on this if I am wrong

- A Party is a person or a group.
- A Party group is a logical grouping of Party's ?
- A Party/Group can have roles defined as PartyRoles ?

So in my case a single person is a Party and a Patient can be represented as
a Party group ? so where does party role fit into the mix?

Thnx

Regards

Edward

-----Original Message-----
From: BJ Freeman [mailto:[hidden email]]
Sent: Monday, December 17, 2007 5:56 PM
To: [hidden email]
Subject: Re: Deleting a table

I have not seen much code using the party role, though that is a good way.

Adrian Crum sent the following on 12/17/2007 8:23 AM:

> Maybe a Patient party role would be more appropriate.
>
>
> BJ Freeman wrote:
>
>> like any relational database, if you have tables that are realated and
>> they have data in them then that data may be lost.
>>
>> as a side note: look at using a party as person and create a Patient
>> Party group. saves doing redundant work
>>
>>
>> Edward Banfa sent the following on 12/17/2007 3:50 AM:
>>
>>> Hi Jacques,
>>>
>>> Ummm, what are the implications of deleting a table in ofbiz apart
>>> from loss
>>> of data contained in that table? Coz I just deleted a table using the
>>> SQL
>>> processor (am actually just learning Ofbiz, am not yet working on a
>>> building
>>> a production app). I had previously defined an entity called Patient and
>>> after a I deleted the table and I restarted ofbiz, I cant see my
>>> entity in
>>> the Entity Data Maintenance page of webtools. Issuing the following
>>> SQL "SELECT * FROM PATIENT" from the SQL processor page throws an
>>> exception, the
>>> trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not
>>> exist.
>>>
>>> Am I missing something here?
>>>
>>> All help appreciated, thx
>>>
>>> Regards
>>>
>>> Edward
>>>
>>> Below are my entitymodel.xml and entitygroup.xml files repectively
>>>
>>> --------------------------------------------------------
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>>
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">

>>>
>>>  <!-- ========================================================= -->
>>>  <!-- ======================== Defaults ======================= -->
>>>  <!-- ========================================================= -->
>>>    <title>Entities for a Hello world component</title>
>>>    <description>None</description>
>>>    <copyright>Copyright (c) Hello World, Inc.</copyright>
>>>    <author>Edward Banfa</author>
>>>    <version>0.1</version>
>>>
>>>    <entity entity-name="Patient" package-name="org.helloworld.emedic"
>>>        title="Entity to represent mentally sick people in government">
>>>        <field name="patientId" type="id-ne"/>
>>>        <field name="firstName" type="id"/>
>>>        <field name="lastName" type="id"/>
>>>        <field name="appointment" type="id"/>
>>>        <prim-key field="patientId"/>         </entity>
>>>   </entitymodel>
>>>
-------------------------------------------------------------------------
>>>
>>>
>>>
-------------------------------------------------------------------------
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>>
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>>>
>>>
>>>
>>>  <entity-group group="org.ofbiz" entity="Patient"/>
>>>
>>> </entitygroup>
>>>
>>>
--------------------------------------------------------------------------

>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jacques Le Roux [mailto:[hidden email]] Sent:
>>> Monday, December 17, 2007 11:56 AM
>>> To: [hidden email]
>>> Subject: Re: Deleting a table
>>>
>>>
http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo

>>>
>>>
>>> Look for Derby, not sure there is exactly an answer but you should
>>> find your
>>> way from there. Beware that it's not recommended to
>>> delete tables in OFBiz...
>>>
>>> Jacques
>>>
>>> De : "Edward Banfa" <[hidden email]>
>>>
>>>> Hi all.
>>>>
>>>>
>>>>
>>>> I would like to know how to delete a table in the Derby database that
>>>
>>> comes
>>>
>>>> with Ofbiz.
>>>>
>>>>
>>>>
>>>> Actually I have a problem with a an entity that I created, I want to
>>>> alter
>>>> the columns on the entity and hence in the underlying table that
>>>
>>> represents
>>>
>>>> the data for the entity. Do I have to drop the existing table or is
>>>> there
>>>
>>> a
>>>
>>>> way I can have ofbiz pickup any changes in the
>>>>
>>>> entity definition and update the db schema ?
>>>>
>>>>
>>>>
>>>> Thank u for ur help in advance
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>>
>>>>
>>>> Edward
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>






Reply | Threaded
Open this post in threaded view
|

Re: Deleting a table

Adrian Crum
Parties, party groups, and party roles are all covered in depth in the Data Model Resource Book.


Edward Banfa wrote:

> Hi all,
> Someone please correct me on this if I am wrong
>
> - A Party is a person or a group.
> - A Party group is a logical grouping of Party's ?
> - A Party/Group can have roles defined as PartyRoles ?
>
> So in my case a single person is a Party and a Patient can be represented as
> a Party group ? so where does party role fit into the mix?
>
> Thnx
>
> Regards
>
> Edward
>
> -----Original Message-----
> From: BJ Freeman [mailto:[hidden email]]
> Sent: Monday, December 17, 2007 5:56 PM
> To: [hidden email]
> Subject: Re: Deleting a table
>
> I have not seen much code using the party role, though that is a good way.
>
> Adrian Crum sent the following on 12/17/2007 8:23 AM:
>
>>Maybe a Patient party role would be more appropriate.
>>
>>
>>BJ Freeman wrote:
>>
>>
>>>like any relational database, if you have tables that are realated and
>>>they have data in them then that data may be lost.
>>>
>>>as a side note: look at using a party as person and create a Patient
>>>Party group. saves doing redundant work
>>>
>>>
>>>Edward Banfa sent the following on 12/17/2007 3:50 AM:
>>>
>>>
>>>>Hi Jacques,
>>>>
>>>>Ummm, what are the implications of deleting a table in ofbiz apart
>>>>from loss
>>>>of data contained in that table? Coz I just deleted a table using the
>>>>SQL
>>>>processor (am actually just learning Ofbiz, am not yet working on a
>>>>building
>>>>a production app). I had previously defined an entity called Patient and
>>>>after a I deleted the table and I restarted ofbiz, I cant see my
>>>>entity in
>>>>the Entity Data Maintenance page of webtools. Issuing the following
>>>>SQL "SELECT * FROM PATIENT" from the SQL processor page throws an
>>>>exception, the
>>>>trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not
>>>>exist.
>>>>
>>>>Am I missing something here?
>>>>
>>>>All help appreciated, thx
>>>>
>>>>Regards
>>>>
>>>>Edward
>>>>
>>>>Below are my entitymodel.xml and entitygroup.xml files repectively
>>>>
>>>>--------------------------------------------------------
>>>>
>>>><?xml version="1.0" encoding="UTF-8"?>
>>>><entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>>
>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
>
>>>> <!-- ========================================================= -->
>>>> <!-- ======================== Defaults ======================= -->
>>>> <!-- ========================================================= -->
>>>>   <title>Entities for a Hello world component</title>
>>>>   <description>None</description>
>>>>   <copyright>Copyright (c) Hello World, Inc.</copyright>
>>>>   <author>Edward Banfa</author>
>>>>   <version>0.1</version>
>>>>
>>>>   <entity entity-name="Patient" package-name="org.helloworld.emedic"
>>>>       title="Entity to represent mentally sick people in government">
>>>>       <field name="patientId" type="id-ne"/>
>>>>       <field name="firstName" type="id"/>
>>>>       <field name="lastName" type="id"/>
>>>>       <field name="appointment" type="id"/>
>>>>       <prim-key field="patientId"/>         </entity>
>>>>  </entitymodel>
>>>>
> -------------------------------------------------------------------------
>
>>>>
>>>>
> -------------------------------------------------------------------------
>
>>>>
>>>><?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>><entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>>
>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>
>>>>
>>>>
>>>> <entity-group group="org.ofbiz" entity="Patient"/>
>>>>
>>>></entitygroup>
>>>>
>>>>
> --------------------------------------------------------------------------
>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>-----Original Message-----
>>>>From: Jacques Le Roux [mailto:[hidden email]] Sent:
>>>>Monday, December 17, 2007 11:56 AM
>>>>To: [hidden email]
>>>>Subject: Re: Deleting a table
>>>>
>>>>
>
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>
>>>>
>>>>Look for Derby, not sure there is exactly an answer but you should
>>>>find your
>>>>way from there. Beware that it's not recommended to
>>>>delete tables in OFBiz...
>>>>
>>>>Jacques
>>>>
>>>>De : "Edward Banfa" <[hidden email]>
>>>>
>>>>>Hi all.
>>>>>
>>>>>
>>>>>
>>>>>I would like to know how to delete a table in the Derby database that
>>>>
>>>>comes
>>>>
>>>>
>>>>>with Ofbiz.
>>>>>
>>>>>
>>>>>
>>>>>Actually I have a problem with a an entity that I created, I want to
>>>>>alter
>>>>>the columns on the entity and hence in the underlying table that
>>>>
>>>>represents
>>>>
>>>>
>>>>>the data for the entity. Do I have to drop the existing table or is
>>>>>there
>>>>
>>>>a
>>>>
>>>>
>>>>>way I can have ofbiz pickup any changes in the
>>>>>
>>>>>entity definition and update the db schema ?
>>>>>
>>>>>
>>>>>
>>>>>Thank u for ur help in advance
>>>>>
>>>>>
>>>>>
>>>>>Regards
>>>>>
>>>>>
>>>>>
>>>>>Edward
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Party

BJ Freeman
In reply to this post by Edward Banfa-2
Party is any person or company.
it can be a person with a role of employee
In you case you would create a role Patient
then you can create a setup for Create Patient
Like the Create Employee
party groups are where you want to group different parties together.
You should also have a permissions for patient

it would be helpful to you before you start out to
read the data modeling book
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Related+Books
and review
Training Videos
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index

Edward Banfa sent the following on 12/17/2007 9:29 AM:

> Hi all,
> Someone please correct me on this if I am wrong
>
> - A Party is a person or a group.
> - A Party group is a logical grouping of Party's ?
> - A Party/Group can have roles defined as PartyRoles ?
>
> So in my case a single person is a Party and a Patient can be represented as
> a Party group ? so where does party role fit into the mix?
>
> Thnx
>
> Regards
>
> Edward
>
> -----Original Message-----
> From: BJ Freeman [mailto:[hidden email]]
> Sent: Monday, December 17, 2007 5:56 PM
> To: [hidden email]
> Subject: Re: Deleting a table
>
> I have not seen much code using the party role, though that is a good way.
>
> Adrian Crum sent the following on 12/17/2007 8:23 AM:
>> Maybe a Patient party role would be more appropriate.
>>
>>
>> BJ Freeman wrote:
>>
>>> like any relational database, if you have tables that are realated and
>>> they have data in them then that data may be lost.
>>>
>>> as a side note: look at using a party as person and create a Patient
>>> Party group. saves doing redundant work
>>>
>>>
>>> Edward Banfa sent the following on 12/17/2007 3:50 AM:
>>>
>>>> Hi Jacques,
>>>>
>>>> Ummm, what are the implications of deleting a table in ofbiz apart
>>>> from loss
>>>> of data contained in that table? Coz I just deleted a table using the
>>>> SQL
>>>> processor (am actually just learning Ofbiz, am not yet working on a
>>>> building
>>>> a production app). I had previously defined an entity called Patient and
>>>> after a I deleted the table and I restarted ofbiz, I cant see my
>>>> entity in
>>>> the Entity Data Maintenance page of webtools. Issuing the following
>>>> SQL "SELECT * FROM PATIENT" from the SQL processor page throws an
>>>> exception, the
>>>> trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not
>>>> exist.
>>>>
>>>> Am I missing something here?
>>>>
>>>> All help appreciated, thx
>>>>
>>>> Regards
>>>>
>>>> Edward
>>>>
>>>> Below are my entitymodel.xml and entitygroup.xml files repectively
>>>>
>>>> --------------------------------------------------------
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
>>>>  <!-- ========================================================= -->
>>>>  <!-- ======================== Defaults ======================= -->
>>>>  <!-- ========================================================= -->
>>>>    <title>Entities for a Hello world component</title>
>>>>    <description>None</description>
>>>>    <copyright>Copyright (c) Hello World, Inc.</copyright>
>>>>    <author>Edward Banfa</author>
>>>>    <version>0.1</version>
>>>>
>>>>    <entity entity-name="Patient" package-name="org.helloworld.emedic"
>>>>        title="Entity to represent mentally sick people in government">
>>>>        <field name="patientId" type="id-ne"/>
>>>>        <field name="firstName" type="id"/>
>>>>        <field name="lastName" type="id"/>
>>>>        <field name="appointment" type="id"/>
>>>>        <prim-key field="patientId"/>         </entity>
>>>>   </entitymodel>
>>>>
> -------------------------------------------------------------------------
>>>>
>>>>
> -------------------------------------------------------------------------
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
>>>>
>>>>
>>>>  <entity-group group="org.ofbiz" entity="Patient"/>
>>>>
>>>> </entitygroup>
>>>>
>>>>
> --------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jacques Le Roux [mailto:[hidden email]] Sent:
>>>> Monday, December 17, 2007 11:56 AM
>>>> To: [hidden email]
>>>> Subject: Re: Deleting a table
>>>>
>>>>
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>
>>>> Look for Derby, not sure there is exactly an answer but you should
>>>> find your
>>>> way from there. Beware that it's not recommended to
>>>> delete tables in OFBiz...
>>>>
>>>> Jacques
>>>>
>>>> De : "Edward Banfa" <[hidden email]>
>>>>
>>>>> Hi all.
>>>>>
>>>>>
>>>>>
>>>>> I would like to know how to delete a table in the Derby database that
>>>> comes
>>>>
>>>>> with Ofbiz.
>>>>>
>>>>>
>>>>>
>>>>> Actually I have a problem with a an entity that I created, I want to
>>>>> alter
>>>>> the columns on the entity and hence in the underlying table that
>>>> represents
>>>>
>>>>> the data for the entity. Do I have to drop the existing table or is
>>>>> there
>>>> a
>>>>
>>>>> way I can have ofbiz pickup any changes in the
>>>>>
>>>>> entity definition and update the db schema ?
>>>>>
>>>>>
>>>>>
>>>>> Thank u for ur help in advance
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>>
>>>>> Edward
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>
>
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Party

Jacques Le Roux
Administrator
Also you can refer to this page (work in progress...) http://docs.ofbiz.org/display/OFBIZ/Glossary
And making it better by adding comments

Jacques

De : "BJ Freeman" <[hidden email]>


> Party is any person or company.
> it can be a person with a role of employee
> In you case you would create a role Patient
> then you can create a setup for Create Patient
> Like the Create Employee
> party groups are where you want to group different parties together.
> You should also have a permissions for patient
>
> it would be helpful to you before you start out to
> read the data modeling book
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Related+Books
> and review
> Training Videos
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index
>
> Edward Banfa sent the following on 12/17/2007 9:29 AM:
> > Hi all,
> > Someone please correct me on this if I am wrong
> >
> > - A Party is a person or a group.
> > - A Party group is a logical grouping of Party's ?
> > - A Party/Group can have roles defined as PartyRoles ?
> >
> > So in my case a single person is a Party and a Patient can be represented as
> > a Party group ? so where does party role fit into the mix?
> >
> > Thnx
> >
> > Regards
> >
> > Edward
> >
> > -----Original Message-----
> > From: BJ Freeman [mailto:[hidden email]]
> > Sent: Monday, December 17, 2007 5:56 PM
> > To: [hidden email]
> > Subject: Re: Deleting a table
> >
> > I have not seen much code using the party role, though that is a good way.
> >
> > Adrian Crum sent the following on 12/17/2007 8:23 AM:
> >> Maybe a Patient party role would be more appropriate.
> >>
> >>
> >> BJ Freeman wrote:
> >>
> >>> like any relational database, if you have tables that are realated and
> >>> they have data in them then that data may be lost.
> >>>
> >>> as a side note: look at using a party as person and create a Patient
> >>> Party group. saves doing redundant work
> >>>
> >>>
> >>> Edward Banfa sent the following on 12/17/2007 3:50 AM:
> >>>
> >>>> Hi Jacques,
> >>>>
> >>>> Ummm, what are the implications of deleting a table in ofbiz apart
> >>>> from loss
> >>>> of data contained in that table? Coz I just deleted a table using the
> >>>> SQL
> >>>> processor (am actually just learning Ofbiz, am not yet working on a
> >>>> building
> >>>> a production app). I had previously defined an entity called Patient and
> >>>> after a I deleted the table and I restarted ofbiz, I cant see my
> >>>> entity in
> >>>> the Entity Data Maintenance page of webtools. Issuing the following
> >>>> SQL "SELECT * FROM PATIENT" from the SQL processor page throws an
> >>>> exception, the
> >>>> trace in console.log says: ERROR 42X05: Table/View 'PATIENT' does not
> >>>> exist.
> >>>>
> >>>> Am I missing something here?
> >>>>
> >>>> All help appreciated, thx
> >>>>
> >>>> Regards
> >>>>
> >>>> Edward
> >>>>
> >>>> Below are my entitymodel.xml and entitygroup.xml files repectively
> >>>>
> >>>> --------------------------------------------------------
> >>>>
> >>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>> <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>>
> >>>>
> > xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
> >>>>  <!-- ========================================================= -->
> >>>>  <!-- ======================== Defaults ======================= -->
> >>>>  <!-- ========================================================= -->
> >>>>    <title>Entities for a Hello world component</title>
> >>>>    <description>None</description>
> >>>>    <copyright>Copyright (c) Hello World, Inc.</copyright>
> >>>>    <author>Edward Banfa</author>
> >>>>    <version>0.1</version>
> >>>>
> >>>>    <entity entity-name="Patient" package-name="org.helloworld.emedic"
> >>>>        title="Entity to represent mentally sick people in government">
> >>>>        <field name="patientId" type="id-ne"/>
> >>>>        <field name="firstName" type="id"/>
> >>>>        <field name="lastName" type="id"/>
> >>>>        <field name="appointment" type="id"/>
> >>>>        <prim-key field="patientId"/>         </entity>
> >>>>   </entitymodel>
> >>>>
> > -------------------------------------------------------------------------
> >>>>
> >>>>
> > -------------------------------------------------------------------------
> >>>>
> >>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>
> >>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>>
> >>>>
> > xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
> >>>>
> >>>>
> >>>>  <entity-group group="org.ofbiz" entity="Patient"/>
> >>>>
> >>>> </entitygroup>
> >>>>
> >>>>
> > --------------------------------------------------------------------------
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Jacques Le Roux [mailto:[hidden email]] Sent:
> >>>> Monday, December 17, 2007 11:56 AM
> >>>> To: [hidden email]
> >>>> Subject: Re: Deleting a table
> >>>>
> >>>>
> > http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
> >>>>
> >>>> Look for Derby, not sure there is exactly an answer but you should
> >>>> find your
> >>>> way from there. Beware that it's not recommended to
> >>>> delete tables in OFBiz...
> >>>>
> >>>> Jacques
> >>>>
> >>>> De : "Edward Banfa" <[hidden email]>
> >>>>
> >>>>> Hi all.
> >>>>>
> >>>>>
> >>>>>
> >>>>> I would like to know how to delete a table in the Derby database that
> >>>> comes
> >>>>
> >>>>> with Ofbiz.
> >>>>>
> >>>>>
> >>>>>
> >>>>> Actually I have a problem with a an entity that I created, I want to
> >>>>> alter
> >>>>> the columns on the entity and hence in the underlying table that
> >>>> represents
> >>>>
> >>>>> the data for the entity. Do I have to drop the existing table or is
> >>>>> there
> >>>> a
> >>>>
> >>>>> way I can have ofbiz pickup any changes in the
> >>>>>
> >>>>> entity definition and update the db schema ?
> >>>>>
> >>>>>
> >>>>>
> >>>>> Thank u for ur help in advance
> >>>>>
> >>>>>
> >>>>>
> >>>>> Regards
> >>>>>
> >>>>>
> >>>>>
> >>>>> Edward
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
> >
> >
>