Page 1 of 1

User-Defined Types in Java

Posted: Wed Nov 25, 2009 8:57 pm
by Adrian_Hudnott
The old Rel web site had substantial information on Rel's capability to accept user-defined type definitions written in Java, but I can no longer find this information any more.

We have a student that wants to use the Date type defined in the provided TypeDate.d script, but an error message appears.

ERROR: RelDatabase: openRelvar failed: ca.mb.armchair.rel3.exceptions.ExceptionFatal: Failed loading heading {X Date(0)}: ca.mb.armchair.rel3.languages.tutoriald.parser.ParseException: Encountered " "(" "( "" at line 1, column 8.
Was expecting one of:     "}" ...     "," ...      Line 1 ca.mb.armchair.rel3.exceptions.ExceptionFatal: RelDatabase: openRelvar failed: ca.mb.armchair.rel3.exceptions.ExceptionFatal: Failed loading heading {X Date(0)}: ca.mb.armchair.rel3.languages.tutoriald.parser.ParseException: Encountered " "(" "( "" at line 1, column 8. Was expecting one of:     "}" ...     "," ...      Line 1      at      at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(      at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(      at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(      at$2.execute(      at      at      at ca.mb.armchair.rel3.client.string.ClientLocal.sendExecute(      at ca.mb.armchair.rel3.dbrowser.ui.PanelCommandline$36.doInBackground(      at javax.swing.SwingWorker$ Source)      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)      at Source)      at Source)      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)      at java.util.concurrent.ThreadPoolExecutor$ Source)      at Source)

Wondered if we're doing anything wrong?



Re: User-Defined Types in Java

Posted: Thu Nov 26, 2009 2:42 pm
by Dave
This is a bug. One of my students just ran across it too. It seems the most recent update to Rel which made some changes to Tutorial D user-defined types broke the Java user-defined types. This will be fixed in the next update. In the mean time, a Date defined as (for example) TYPE Date POSSREP {year INTEGER, month INTEGER, day INTEGER}; should do the job.

Re: User-Defined Types in Java

Posted: Thu Nov 26, 2009 7:05 pm
by Adrian_Hudnott
Cool. We much prefer the new Tutorial D native user-defined types anyway but I just thought I'd mention it since it's shipped as a demo example.

Re: User-Defined Types in Java

Posted: Thu May 28, 2015 2:44 pm
by leaute
Impossible to define Date type in release 1.0.12. Here is the error message :

ERROR: RS0012: Creation of type Date failed: ca.mb.armchair.rel3.exceptions.ExceptionSemantic:
 RS0008: Unable to add operators for Database.RelUserCode.Date: 
ca.mb.armchair.rel3.exceptions.ExceptionSemantic: RS0004: Java error: cannot find symbol
  symbol:   class Date   location: class Database.RelUserCode.op_Date_:  in line 8 of: RegularFileObject[/home/gibus/BDD/Rel/Database/RelUserCode/] Java error: cannot find symbol   symbol:   class Date   location: class Database.RelUserCode.op_Date_:  in line 10 of: RegularFileObject[/home/gibus/BDD/Rel/Database/RelUserCode/]

It was OK in 1.0.11 release.

Re: User-Defined Types in Java

Posted: Thu May 28, 2015 3:08 pm
by Dave
It's fixed in 1.0.13, which is getting closer to release.