Persistance - OneToMany Relationships - RAGE!

Discussion in 'Plugin Development' started by FuzzeWuzze, Jun 3, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    FuzzeWuzze

    So, im totally confused because i have no idea wtf is going on. Ive read like 5 different java examples on this and copied their layout exactly, but Bukkit/Persistence refuses to build the setup.

    What im trying to do:
    There are two tables, town(class TownyTown), and resident(TownyResident).

    I want it to be a bidirectional OneToMany and ManyToOne relationship.
    Residents have one town, and Town's have multiple residents.

    Is there something in the implementation of Bukkit that prevents this from happening or something?
    Regardless here is my info

    The crash log
    http://pastebin.com/cG4jB458

    My TownyTown class
    http://pastebin.com/M8zPASz7

    My TownyResident class
    http://pastebin.com/ZmGcrtgQ

    My Database Setup that initiates all of this just incase that matters...although i dont think it is as its crashing inside installDDL()
    http://pastebin.com/92N6qgKg

    Im dying for help on this, ive probably wasted a good 3 hours trying different methods, and i always come back to this error saying that theres a missing database or something?
     
  2. Offline

    shadrxninga

    @FuzzeWuzze
    hmm... I not really that good with databases and I doubt this is the problem - but just in case... :p, Do you have database: true in the plugin.yml?
     
  3. Offline

    FuzzeWuzze

    Yes :)

    It doesnt do anything without that...
     
  4. Offline

    shadrxninga

    Yep, I spent about an hour fiddling through my code trying to find out what was wrong.Only to find I had forgotten that...
     
  5. Offline

    FuzzeWuzze

    Yea....unfortunately i was afraid not many people would be doing what im doing...
     
  6. Offline

    Archelaus

    You can't use those tags on a SQLite database.
     
  7. Offline

    masteroftime

    I looked into the SQLite statement syntax again and noticed that it wont work because you cant add table constraints in the ALTER TABLE command.

    If you dont believe me look here: http://www.sqlite.org/lang_altertable.html
     
  8. Offline

    MiHo

    So you can't use the Relations in Persitance? Or could you set it to "h2" or "mysql" and will work in "bukkit.yml"?
     
  9. Offline

    masteroftime

    Yep. Just use another DBMS and it should work.
     
Thread Status:
Not open for further replies.

Share This Page