How to use Grails belongsTo in Java

295 views Asked by At

I have this situation in grails

static belongsTo = [owner: Publisher]

How can I convert this in java?

1

There are 1 answers

1
Joshua Moore On BEST ANSWER

The short answer is You can not convert it to java.

The longer answer, and reason why, is because that static property is used by Grails to enhance your class with additional methods and functionality using Groovy meta programming. This type of meta programming isn't available in Java and one of the primary reasons why Groovy is used in this case.

Without knowing why you want to do so it's impossible to suggest any alternative approach.