Results 1 to 6 of 6

Thread: Java functions

  1. #1
    victorq is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Java functions

    Hello.

    If a function doesn't exist in my java project, can I redirect and run another generic function?
    The project I'm trying to implement will try to execute a lot of functions whose names will be known only at run time.
    So I would like to implement a generic function that will be executed when java will try to execute a inexistent function.

    Thank you.

  2. #2
    joeyvitoro is offline Member
    Join Date
    Oct 2011
    Posts
    90
    Rep Power
    0

    Default Re: Java functions

    I would suggest that this could be handled differently. What are you trying to do, specifically?

  3. #3
    victorq is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: Java functions

    I would be happy to to this any another way.

    I need to connect to different databases types and analyze the tables and the relations between these tables. I tried Hibernate for this project.

    So if I have a table called customers with a column "name", then I must have the function "getName" in the class "customer.java". This is how Hibernate works
    But I must do this at run time and at run time I don't have the class customer.java created.

    I already asked on Hibernate forum if I can do something in Hibernate to fix this but I don't have an answer yet.
    And here I asked if java can help about this problem at a upper level.
    Hope this is not interpreted as a double post...

    Thank you.
    Last edited by victorq; 10-26-2011 at 08:47 PM.

  4. #4
    joeyvitoro is offline Member
    Join Date
    Oct 2011
    Posts
    90
    Rep Power
    0

    Default Re: Java functions

    And what run time event triggers which database you connect to?

  5. #5
    victorq is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: Java functions

    I choose the database so this is not a problem.

  6. #6
    victorq is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: Java functions

    I guess I should catch the exception that is thrown on the missing function and execute my generic function.
    But it doesn't sound right.

Similar Threads

  1. Replies: 0
    Last Post: 10-03-2011, 08:27 AM
  2. Calling java functions from c++
    By khajalid in forum New To Java
    Replies: 13
    Last Post: 10-12-2010, 10:50 PM
  3. Replies: 0
    Last Post: 03-09-2010, 06:26 AM
  4. JSP functions and Java Bean methods
    By lisa.lipsky in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 07-07-2009, 07:29 AM
  5. java copy paste cut and undo functions
    By Mr tuition in forum AWT / Swing
    Replies: 1
    Last Post: 12-09-2007, 12:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •