NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Re: Modifying classes generated by the Restful webservices Wizard

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
tdeit62



Joined: 06 Oct 2011
Posts: 36

PostPosted: Thu Oct 20, 2011 11:57 am    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

I generally make a copy of each Facade class (and entity class if I’ve made changes to the named queries etc) from the previous generation before using the wizard to recreate the classes. Then it’s simply a matter of copying across any manual changes I made to the new entity classes and deleting the previous generation. Diff is a great help there.

Tony Dietrich

From: Jan Rosendahl [mailto:address-removed]
Sent: 20 October 2011 11:22
To: Netbeans J2ee Mailing List
Subject: [nbj2ee] Modifying classes generated by the Restful webservices Wizard


Hi,


suppose I create some entities + session beans with the 'Restful web services from database'

wizard which works fine.



For example:

database table: 'User' => wizard creates: entity: User.java + session bean: UserFacadeREST.java



I want to make some changes to these classes ( e.g. add some named queries to User.java

and respective methods in Facade which use these queries ). Now when the database

table is extended and the classes have to be re-created the changes are lost.



So I have to do something like create my own 'MyUserFacadeREST' subclass of

UserFacadeREST to implement my modifications. But session beans are not

allowed to extend other session beans...



Maybe it's more a 'session bean' question but I think everyone using this

generator will also have this problem.



So how can this be handled? Is there already some best practice?
Back to top
Steven Siebert
Posted via mailing list.





PostPosted: Thu Oct 20, 2011 12:40 pm    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

Hi Jan,

You didn't mention if you are using JAX-RS for your RESTful services or something else.
Back to top
Jan Rosendahl
Posted via mailing list.





PostPosted: Thu Oct 20, 2011 12:56 pm    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

@Tony:
Back to top
Jan Rosendahl
Posted via mailing list.





PostPosted: Thu Oct 20, 2011 1:03 pm    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

.. I just saw that answering like I just did (@Tony,@Steven..) doesn't make lots of sense so
I repost this answer to have it at the correct position:


Hi Steven,


I use JAX-RS (Jersey) for the REST services which produce both xml and json. I'm just reading something about EJB and the @Inheritance annotation but don't know yet if that's the way to go.. Does jax-rs itself offer something?
Back to top
Jan Rosendahl
Posted via mailing list.





PostPosted: Thu Oct 20, 2011 1:33 pm    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

Ok, so now I got half the way of it:

1) Netbeans generates User.java and UserFacadeREST.java ( session bean )
2) I want to have some special behavior in UserFacadeREST
Back to top
Jan Rosendahl
Posted via mailing list.





PostPosted: Thu Oct 20, 2011 3:03 pm    Post subject: Re: Modifying classes generated by the Restful webservices Wizard Reply with quote

Last update for today:

The 'Restful Webservices from Database' wizard is so kind to merge the
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo