public inbox for [email protected]  
help / color / mirror / Atom feed
[Pljava-dev] Possible bug in trigger annotations
3+ messages / 2 participants
[nested] [flat]

* [Pljava-dev] Possible bug in trigger annotations
@ 2016-02-07 22:34  Petr Michálek <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Petr Michálek @ 2016-02-07 22:34 UTC (permalink / raw)

Hi,

generation of pljava.ddr by java annotations is OK, but on trigger
execution returns an exception:

"org.postgresql.util.PSQLException: ERROR: Triggers can not have a java
parameter declaration."

Workaround is replace "(org.postgresql.pljava.TriggerData)" with "" in file
pljava.ddr
Please confirm the bug or tell me what I'm doing wrong.

And I have little comment to documentation. I didn't found if the javac
generate pljava.ddr or annotation is read by deployer. For example IDE
(Eclipse) does not generate pljava.ddr (do not know why) and I must run
javac.

Petr

_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Pljava-dev] Possible bug in trigger annotations
@ 2016-02-07 23:32  Chapman Flack <[email protected]>
  parent: Petr Michálek <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Chapman Flack @ 2016-02-07 23:32 UTC (permalink / raw)

On 02/07/16 17:34, Petr Michálek wrote:

> "org.postgresql.util.PSQLException: ERROR: Triggers can not have a java
> parameter declaration."
> 
> Workaround is replace "(org.postgresql.pljava.TriggerData)" with "" in file
> pljava.ddr
> Please confirm the bug or tell me what I'm doing wrong.

Bug. I've opened https://github.com/tada/pljava/issues/92 for it. Thanks!

> And I have little comment to documentation. I didn't found if the javac
> generate pljava.ddr or annotation is read by deployer. For example IDE
> (Eclipse) does not generate pljava.ddr (do not know why) and I must run
> javac.

I am not sure exactly what you are asking, but as far as how pljava.ddr
is generated, it is generated by the Java compiler at the same time as
it compiles classes.

The pljava-api jar file has to be on the classpath given to the compiler,
so the compiler finds the generator class.  For example, the Hello example

https://tada.github.io/pljava/use/hello.html

shows building with Maven, with pljava-api added as a dependency; that
automatically puts pljava-api's jar file on the compiler classpath.
If you run javac by hand, of course you can add that jar with -cp.
(If you do not have the separate pljava-api jar, you can point the
compiler to the full pljava jar, which also contains all the api classes.
Come to think of it, I should add pljava-api to what gets packaged in
the self-extracting jar.)

Ordinarily, you would notice if that jar were not on the classpath, because
the compiler would not find the annotation classes.

As to why Eclipse does not generate the file, I have no immediate answer.
Does Eclipse have any settings to enable/disable annotation processing?
If you find the solution before I do I'll happily add it in an Eclipse
special topic in the docs.

Even when using javac or maven, I do find it useful to do a clean before
every recompile. Otherwise, sometimes the tools will be 'smart' and
run the compiler on only some source files that have changed, and then
the generated ddr will be incomplete, containing only what was in the files
the compiler looked at. That is definitely something I should add to docs.

-Chap
_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Pljava-dev] Possible bug in trigger annotations
@ 2016-02-08 00:56  Chapman Flack <[email protected]>
  parent: Chapman Flack <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Chapman Flack @ 2016-02-08 00:56 UTC (permalink / raw)

On 02/07/16 18:32, Chapman Flack wrote:
> On 02/07/16 17:34, Petr Michálek wrote:
> 
>> "org.postgresql.util.PSQLException: ERROR: Triggers can not have a java
>> parameter declaration."

> Bug. I've opened https://github.com/tada/pljava/issues/92 for it. Thanks!

I have pushed the fix on both the master and the REL1_5_STABLE branch
(which is now beyond 1.5.0-BETA1).  If you want it now you can checkout
the branch directly, or after some more days/bugs I will probably make
a -BETA2 or -RC.

-Chap
_______________________________________________
Pljava-dev mailing list
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-02-08 00:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-02-07 22:34 [Pljava-dev] Possible bug in trigger annotations Petr Michálek <[email protected]>
2016-02-07 23:32 ` Chapman Flack <[email protected]>
2016-02-08 00:56   ` Chapman Flack <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox