My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 454: Change data definition to something else then "end" (end maybe "start")
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Apr 2010


Sign in to add a comment
 
Reported by christia...@gmail.com, Apr 21, 2010
Tried to involve the FullCalendar into a (g)rails project. The attribute "end" got some really nice 
errors regarding the existence of the chars "end" while  creating the database backend (sql).

The result is that we have to rename our Domain attributes to something else and buil the JSON 
"by hand".(Otherwise with the attribute "Date end" the project won't compile.)

Without that issue, a nice automatic JSON is not possible to be generated.

The question would be to move away from SQL  keywords in the "EventData" in general, as I am 
sure the provider(s) of such a nice plugin do care.

Regards and thanks a lot 
chris

Apr 21, 2010
#2 christia...@gmail.com
Excuse me, but for the Title, it should be "(and maybe for "start"). 

It's late in here:)
Apr 27, 2010
Project Member #3 adamrs...@gmail.com
hi christian,
though i dont know grails at all, i can imagine there is a way to escape this sort of thing. even if it is 
impossible, i don't think i'd change the names of these properties because of incompatibilities with a single 
web framework
Status: Done
Apr 29, 2010
#4 christia...@gmail.com
Is there any possibility to define the naming convention of the event's start and end
param?

Here is the log of grails trying to generate the table(should be the same in RoR):

Resolving dependencies...
Dependencies resolved in 1683ms.
Running script /usr/share/grails/scripts/RunApp.groovy
Environment set to development
   [delete] Deleting directory /Users/chris/.grails/1.2.2/projects/roommate/tomcat
Running Grails application..
loading security config ...
2010-04-29 12:29:47,762 [main] ERROR hbm2ddl.SchemaExport  - Unsuccessful: create
table item_event (id bigint generated by default as identity (start with 1), version
bigint not null, title varchar(255) not null, start timestamp not null, description
varchar(255) not null, end timestamp not null, primary key (id))
2010-04-29 12:29:47,763 [main] ERROR hbm2ddl.SchemaExport  - Unexpected token: END in
statement [create table item_event (id bigint generated by default as identity (start
with 1), version bigint not null, title varchar(255) not null, start timestamp not
null, description varchar(255) not null, end]
2010-04-29 12:29:47,768 [main] ERROR hbm2ddl.SchemaExport  - Unsuccessful: alter
table item_item_event add constraint FK5F93B71A1E1A57B3 foreign key (item_event_id)
references item_event
2010-04-29 12:29:47,768 [main] ERROR hbm2ddl.SchemaExport  - Table not found in
statement [alter table item_item_event add constraint FK5F93B71A1E1A57B3 foreign key
(item_event_id) references item_event]
Dec 7, 2010
#5 martin....@gmail.com
In a Grails domain class you can override the default column name, such that the property is called 'end', but it's mapped to a column called 'end_time', for example:

==============================
  DateTime start
  DateTime end
  static mapping = {
    start column: 'start_time'
    end column: 'end_time'
  }
==============================
Sign in to add a comment

Powered by Google Project Hosting