How can I remove a domain class?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I remove a domain class?

Adolfo Ordiñana
Hi,
I create a domain-class, it's not so good for me and I would like delete it.
I remove the groovy class in the "domain" path, the class controller and
the class views. But in some place the class may be referenced, because,
if I try to create another class with the same name, grails show one
message about duplicated files.

How can I delete the domain class once and for all?

Thank you very much!

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

Brad Whitaker
Did you try 'grails clean' ?

aordin wrote
Hi,
I create a domain-class, it's not so good for me and I would like delete it.
I remove the groovy class in the "domain" path, the class controller and
the class views. But in some place the class may be referenced, because,
if I try to create another class with the same name, grails show one
message about duplicated files.

How can I delete the domain class once and for all?
Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

Adolfo Ordiñana
In reply to this post by Adolfo Ordiñana
To Brad:
   In Grails documentation (http://grails.org/doc/1.0.x/) explain that
'The |clean| command will  delete all compiled resources from the
current Grails application' but I need delete the source code of one
class created with 'grails create-domain-class'

To Dean:
  I don't understand what do you mean, and what is the way to remove the
class with your tip.
  Can you explain with more detail your idea please?

I think I try to delete it by hand and I hope it will not cause any
problem in the future.

If anybody have a better solution, please reply this message.

Thank you a lot!!

Adolfo Ordiñana wrote:

> Hi,
> I create a domain-class, it's not so good for me and I would like
> delete it.
> I remove the groovy class in the "domain" path, the class controller
> and the class views. But in some place the class may be referenced,
> because, if I try to create another class with the same name, grails
> show one message about duplicated files.
>
> How can I delete the domain class once and for all?
>
> Thank you very much!
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

Brad Whitaker
Did you try it? There is certainly no harm in trying. You said that you had already deleted your source code. Perhaps the problem you are seeing is from compiled resources. This kind of thing happens. Maybe it will solve your problem (or maybe it won't).

Adolfo Ordiñana wrote
To Brad:
   In Grails documentation (http://grails.org/doc/1.0.x/) explain that
'The |clean| command will  delete all compiled resources from the
current Grails application' but I need delete the source code of one
class created with 'grails create-domain-class'
tgm
Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

tgm
In reply to this post by Adolfo Ordiñana
Did you also remove the test class that gets generated?

What file is it complaining about being duplicate?
Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

rphutchinson
In reply to this post by Brad Whitaker
I'll second that, what I've found is as a general rule, any time you delete or rename a domain class you should do a grails clean.  


Brad Whitaker wrote
Did you try it? There is certainly no harm in trying. You said that you had already deleted your source code. Perhaps the problem you are seeing is from compiled resources. This kind of thing happens. Maybe it will solve your problem (or maybe it won't).

Adolfo Ordiñana wrote
To Brad:
   In Grails documentation (http://grails.org/doc/1.0.x/) explain that
'The |clean| command will  delete all compiled resources from the
current Grails application' but I need delete the source code of one
class created with 'grails create-domain-class'
Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

Adolfo Ordiñana
I remove the class, the controller and the test classes manually,
execute the "maven clean" and I don't find any problem, seems all is ok.
Thank you!

Patrick Hutchinson wrote:

> I'll second that, what I've found is as a general rule, any time you delete
> or rename a domain class you should do a grails clean.  
>
>
>
> Brad Whitaker wrote:
>  
>> Did you try it? There is certainly no harm in trying. You said that you
>> had already deleted your source code. Perhaps the problem you are seeing
>> is from compiled resources. This kind of thing happens. Maybe it will
>> solve your problem (or maybe it won't).
>>
>>
>> Adolfo Ordiñana wrote:
>>    
>>> To Brad:
>>>    In Grails documentation (http://grails.org/doc/1.0.x/) explain that
>>> 'The |clean| command will  delete all compiled resources from the
>>> current Grails application' but I need delete the source code of one
>>> class created with 'grails create-domain-class'
>>>
>>>      
>>    
>
>  


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How can I remove a domain class?

Kelechi
In reply to this post by Adolfo Ordiñana
Hello.. you can use the refactor to feature on your IDE to change the controller instead of deleteing... it changes it everywhere else. Hope this helps.