|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Why there is not enought foreign keys ?Hi dudes! I'm trying blojsom on my personal website, that uses Oracle Database. I was reviewing the database model, and I'm wondering why there is no foreign key between some tables, for example entry_id column on comment table (that should refer to entry_id on entry table), or a self-reference foreign key on category_id and parent_category_id on category table. I'm really considering creating this FK by my own, but since I didn't give a deep look at the source code I'd like to know from you guys if there is any situation on this app where FK is not welcome.
Could you clarify it for me? Thanks in advance!
------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Jul 16, 2009, at 2:24 PM, YakultSan wrote: > Hi dudes! I'm trying blojsom on my personal website, that uses > Oracle Database. I was reviewing the database model, and I'm > wondering why there is no foreign key between some tables, for > example entry_id column on comment table (that should refer to > entry_id on entry table), or a self-reference foreign key on > category_id and parent_category_id on category table. I'll defer to David C. on the Oracle scripts, and even the data model, their history and review. > I'm really considering creating this FK by my own, but since I > didn't give a deep look at the source code I'd like to know from you > guys if there is any situation on this app where FK is not welcome. > > Could you clarify it for me? If you decide to do this, the Hibernate models will need to be appropriately updated and annotated where columns are added and noted as foreign keys. In fact, the nature of the relationship might be completely managed by hibernate's dialect model. Oracles' Hibernate configuration is located in src/properties/oracle Are you familiar with Hibernate? Regards, Tim -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Ask me how you can start digitally signing your email! iEYEARECAAYFAkpfdr0ACgkQ5ypOrCMXsT1BzQCggyLqdQ9sTqmwydHUAkVgNVcN 27wAmwaCoazS8J9BEFCzP5pjHONxE0+K =/Jfp -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?Hello Tim! Thanks for your reply. I didn't realize about updating Hibernate models, but you're totally right! Well, since updating source code is a little bit dangerous let me try another way. Do you have a tip on how to avoid concurrent admin users to not mess with the database? Using two browsers I was able to put a removed category as parent category, and it crashed my blog. I could do it on the "uncategorised" category and somehow it make me unable even to login on the backend. What is your suggestion here?
Best Regards. On Thu, Jul 16, 2009 at 3:51 PM, Timothy Stone <blojsom.developer@...> wrote: -----BEGIN PGP SIGNED MESSAGE----- ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Jul 16, 2009, at 7:38 PM, YakultSan wrote: > Hello Tim! Thanks for your reply. I didn't realize about updating > Hibernate models, but you're totally right! Well, since updating > source code is a little bit dangerous let me try another way. If you were to review the data model, in a platform independent way, and find optimizations that could improve the relationships, please do so. The model has served the engine well, but I can't speak for it's history and development. If changes were made, the Hibernate mappings could be updated by myself or another. > Do you have a tip on how to avoid concurrent admin users to not mess > with the database? > Using two browsers I was able to put a removed category as parent > category, and it crashed my blog. I could do it on the > "uncategorised" category and somehow it make me unable even to login > on the backend. Sounds like a bug candidate. I will attempt this as well. Can you tell me if you are using the Quickstart, or the new HSQLDB "Quicker start" bundle? > What is your suggestion here? Roughly, I would consider a "secure login" table that records the user id, timestamp, and session id at login. If during authentication it was determined that a) the user was currently logged in AND b) had a different/new session id, a failed login exception could be thrown. This could be thought out a bit more of course, but is typical of most patterns involving this extra measure of security. Regards, Tim > > On Thu, Jul 16, 2009 at 3:51 PM, Timothy Stone <blojsom.developer@... > > wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On Jul 16, 2009, at 2:24 PM, YakultSan wrote: > > > Hi dudes! I'm trying blojsom on my personal website, that uses > > Oracle Database. I was reviewing the database model, and I'm > > wondering why there is no foreign key between some tables, for > > example entry_id column on comment table (that should refer to > > entry_id on entry table), or a self-reference foreign key on > > category_id and parent_category_id on category table. > > I'll defer to David C. on the Oracle scripts, and even the data model, > their history and review. > > > I'm really considering creating this FK by my own, but since I > > didn't give a deep look at the source code I'd like to know from you > > guys if there is any situation on this app where FK is not welcome. > > > > Could you clarify it for me? > > If you decide to do this, the Hibernate models will need to be > appropriately updated and annotated where columns are added and noted > as foreign keys. In fact, the nature of the relationship might be > completely managed by hibernate's dialect model. > > Oracles' Hibernate configuration is located in src/properties/oracle > > Are you familiar with Hibernate? > > Regards, > Tim > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.8 (Darwin) > Comment: Ask me how you can start digitally signing your email! > > iEYEARECAAYFAkpfdr0ACgkQ5ypOrCMXsT1BzQCggyLqdQ9sTqmwydHUAkVgNVcN > 27wAmwaCoazS8J9BEFCzP5pjHONxE0+K > =/Jfp > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Blojsom-developers mailing list > Blojsom-developers@... > https://lists.sourceforge.net/lists/listinfo/blojsom-developers > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > Blojsom-developers mailing list > Blojsom-developers@... > https://lists.sourceforge.net/lists/listinfo/blojsom-developers -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Ask me how you can start digitally signing your email! iEYEARECAAYFAkpf0H4ACgkQ5ypOrCMXsT3v4QCgvSRUTYmrs7MBu9YKzH2OGjbp 7AwAoLXHeKt6B/AoPldnBti6O/lIEAOv =EOzZ -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Jul 16, 2009, at 2:24 PM, YakultSan wrote: > Hi dudes! I'm trying blojsom on my personal website, that uses > Oracle Database. I was reviewing the database model, and I'm > wondering why there is no foreign key between some tables, for > example entry_id column on comment table (that should refer to > entry_id on entry table), or a self-reference foreign key on > category_id and parent_category_id on category table. I started looking at this. I'm not a "Data Modeler" but play one on TV. :) Looking at some of the *other* scripts, foreign keys were created. Whether they are correct or optimized is another question. Here's an example from the HSQLDB script using your observations: > CREATE TABLE Comment ( > comment_id int GENERATED BY DEFAULT AS IDENTITY (START WITH 1, > INCREMENT BY 1) NOT NULL PRIMARY KEY, > entry_id int NOT NULL, > author varchar(100), > author_url varchar(255), > author_email varchar(100), > comment longvarchar, > date timestamp NOT NULL, > ip varchar(30) default NULL, > status varchar(100) default NULL, > comment_parent int default NULL, > blog_id int NOT NULL, > CONSTRAINT comment_blog_blogidfk FOREIGN KEY (blog_id) REFERENCES > Blog (id) ON DELETE CASCADE > ) ; This is the table statement is from the hsqldb script (checked in on SVN). Note that the FK ties back to the Blog table. Is this what you are looking for? The reason they are missing from Oracle? Probably many, most likely because Oracle is not open-source and doesn't get a lot of attention from committers working locally (choosing mysql, postgres and many others first). I'm considering having a professional data modeler at work look at the Oracle scripts--we do have *the* Oracle author working three seats from me...I don't need to drop names ;) It might be an opportunity to really 'eek out some improvements. > I'm really considering creating this FK by my own, but since I > didn't give a deep look at the source code I'd like to know from you > guys if there is any situation on this app where FK is not welcome. As I said, your review of the Oracle scripts would be welcome! > > Could you clarify it for me? > > Thanks in advance! > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > Blojsom-developers mailing list > Blojsom-developers@... > https://lists.sourceforge.net/lists/listinfo/blojsom-developers -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Ask me how you can start digitally signing your email! iEYEARECAAYFAkpjLnoACgkQ5ypOrCMXsT0dHQCdFgIgaI6qBVVGF6q7N6DIoOsg idoAnjZC7Bo/J41E6mWzbLpCDNaCSV+j =59xG -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?Hi guys! Thanks for this! As I told you, this is just for my personal website. I'll keep you in touch of any development from my side. Once again, thanks for this quick response!
Best Regards! On Sun, Jul 19, 2009 at 11:32 AM, Timothy Stone <blojsom.developer@...> wrote:
------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
|
|
Re: Why there is not enought foreign keys ?-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Jul 20, 2009, at 6:35 PM, YakultSan wrote: > Hi guys! Thanks for this! As I told you, this is just for my > personal website. I'll keep you in touch of any development from my > side. Once again, thanks for this quick response! You're welcome. If you want to look at the scripts for the various databases supported, you can check out the just the SQL code at: * from the command line (in your favorite terminal with SVN commands) svn co https://blojsom.svn.sourceforge.net/svnroot/blojsom/branches/blojsom-3.3/sql-scripts blojsom-sql * sourceforge.net SVN browsing http://blojsom.svn.sourceforge.net/viewvc/blojsom/branches/blojsom-3.3/sql-scripts/ Hopefully, some of the other scripts will provide you some direction in the FKs needed to normalize the Oracle scripts. I was able to interest a senior modeler at work to review the Oracle scripts as well. Regards, Tim > On Sun, Jul 19, 2009 at 11:32 AM, Timothy Stone <blojsom.developer@... > > wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On Jul 16, 2009, at 2:24 PM, YakultSan wrote: > > > Hi dudes! I'm trying blojsom on my personal website, that uses > > Oracle Database. I was reviewing the database model, and I'm > > wondering why there is no foreign key between some tables, for > > example entry_id column on comment table (that should refer to > > entry_id on entry table), or a self-reference foreign key on > > category_id and parent_category_id on category table. > > I started looking at this. I'm not a "Data Modeler" but play one on > TV. :) > > Looking at some of the *other* scripts, foreign keys were created. > Whether they are correct or optimized is another question. Here's an > example from the HSQLDB script using your observations: > > > CREATE TABLE Comment ( > > comment_id int GENERATED BY DEFAULT AS IDENTITY (START WITH 1, > > INCREMENT BY 1) NOT NULL PRIMARY KEY, > > entry_id int NOT NULL, > > author varchar(100), > > author_url varchar(255), > > author_email varchar(100), > > comment longvarchar, > > date timestamp NOT NULL, > > ip varchar(30) default NULL, > > status varchar(100) default NULL, > > comment_parent int default NULL, > > blog_id int NOT NULL, > > CONSTRAINT comment_blog_blogidfk FOREIGN KEY (blog_id) REFERENCES > > Blog (id) ON DELETE CASCADE > > ) ; > > This is the table statement is from the hsqldb script (checked in on > SVN). Note that the FK ties back to the Blog table. Is this what you > are looking for? > > The reason they are missing from Oracle? Probably many, most likely > because Oracle is not open-source and doesn't get a lot of attention > from committers working locally (choosing mysql, postgres and many > others first). > > I'm considering having a professional data modeler at work look at the > Oracle scripts--we do have *the* Oracle author working three seats > from me...I don't need to drop names ;) It might be an opportunity to > really 'eek out some improvements. > > > I'm really considering creating this FK by my own, but since I > > didn't give a deep look at the source code I'd like to know from you > > guys if there is any situation on this app where FK is not welcome. > > As I said, your review of the Oracle scripts would be welcome! > > > > > Could you clarify it for me? > > > > Thanks in advance! > > > > > > > ------------------------------------------------------------------------------ > > Enter the BlackBerry Developer Challenge > > This is your chance to win up to $100,000 in prizes! For a limited > > time, > > vendors submitting new applications to BlackBerry App World(TM) will > > have > > the opportunity to enter the BlackBerry Developer Challenge. See > > full prize > > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > > Blojsom-developers mailing list > > Blojsom-developers@... > > https://lists.sourceforge.net/lists/listinfo/blojsom-developers > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.8 (Darwin) > Comment: Ask me how you can start digitally signing your email! > > iEYEARECAAYFAkpjLnoACgkQ5ypOrCMXsT0dHQCdFgIgaI6qBVVGF6q7N6DIoOsg > idoAnjZC7Bo/J41E6mWzbLpCDNaCSV+j > =59xG > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Blojsom-developers mailing list > Blojsom-developers@... > https://lists.sourceforge.net/lists/listinfo/blojsom-developers > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > Blojsom-developers mailing list > Blojsom-developers@... > https://lists.sourceforge.net/lists/listinfo/blojsom-developers -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Ask me how you can start digitally signing your email! iEYEARECAAYFAkply30ACgkQ5ypOrCMXsT3xYACgpOl5lQe1HFPJVcmL/JNpwZO4 k8gAnRWo/O2hcCsPkgttN+sn/W9t7K91 =AvXF -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Blojsom-developers mailing list Blojsom-developers@... https://lists.sourceforge.net/lists/listinfo/blojsom-developers |
| Free embeddable forum powered by Nabble | Forum Help |