• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Replacing GenericUserDAO

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I'm trying to override GenericUserDAO for a MySQL database.

I created a subclass of GenericUserDAO named QRUserDAO and overrode the factory method MysqlDataAccessDriver.newUserDAO() by creating a subclass named QRDataAccessDriver.

I edited the conf/database/mysql/mysql.properties file so that it would load QRDataAccessDriver instead of MysqlDataAccessDriver.

However, my changes don't create a QRDataAccessDriver object. It turned out that there's another dao.driver=net.jforum.dao.mysql.MysqlDataAccessDriver property in jforum-custom.conf that is overriding the one in myqel.properties. If I remove it, I get the message



Looking in DatabaseWorkarounder it appears that net.jforum.dao.mysql.MysqlDataAccessDriver is hard-coded. If the class of the driver is anything other than MysqlDataAccessDriver, the driver is replaced and the configuration overridden.

So how does one replacing GenericUserDAO?

[originally posted on jforum.net by jbucanek]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hhhm.. I ignored this possibility.

This "workarounder" exists because the shit MySQL AB does on every new version of their database server..

You can register this bug at Jira, and, to make it working for you now, you can just change the code to not use the JForum version of the mysql dao driver.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For now, that's what I did.


Since my installation of MySQL won't be changing any time soon, this will work for now.

I'll file a bug.

Thinking about the problem, there should be a better way to handle this, but I'll have to put on my thinking cap.
[originally posted on jforum.net by jbucanek]
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic