gvSIGAssociation / gvnix

gvNIX project
http://www.gvnix.org
GNU General Public License v3.0
41 stars 19 forks source link

Loupe problem #24

Closed jaimemm closed 8 years ago

jaimemm commented 8 years ago

Hi,

We have two child classes: Child1,Child2 that inherits from the same a class ParentClass, and only the class ParentClass.

We have a class A that contains a field parentList of type set field. This parentList is a list of ParentClass instances Ids

private Set parentList = new HashSet();

What we really want to achieve, is to select multiple values from either Child1 and Child2, and assign them to the parentList set field in class A, using Loupe.

When we try to execute the loupe command over the parentList field of class A, we get the following error:

"Field 'parentList' could not implement Loupe Field."

What are the restrictions on the fields to use Loupe? Is what we want to achieve, possible?

jaimemm commented 8 years ago

We are using gvnix 2.0.0.M1

jcagarcia commented 8 years ago

Hi @jaimemm ,

At first, thanks for your interest on gvNIX project.

Could you provide us your log.roo file with the executed commands to be able to analyze your issue?

Regards,

jaimemm commented 8 years ago

Hi @jcagarcia,

Did you receive the log.roo? We sent it over via email, and got no response since more than 3 weeks ago.

Regards

jcagarcia commented 8 years ago

Hi @jaimemm,

Sorry, but I didn't receive any email related with this issue... Could you copy your log.roo file on this registered issue?

Best Regards,

jaimemm commented 8 years ago

Hi @jcagarcia ,

Esto es todo lo que aparece en el log.roo.

web mvc loupe set --controller ~.web.StubController web mvc loupe field --controller ~.web.StubController --field parentValue2

RESULT--> Field 'parent Value2' could not implements Loupe Field.

jcagarcia commented 8 years ago

Hi @jaimemm,

Sorry, but to be able to test your issue we need more information about the project structure and the commands that you have used to generate your project...

Provide a complete log.roo with all project and entitiies generation to be able to test it.

Regards,

jaimemm commented 8 years ago

Hi @jcagarcia,

The entities have not been generated using roo, so they do not appear in the log.roo

Any work around?

KR

jcagarcia commented 8 years ago

You could generate a proof application using gvNIX commands that follows your real application structure.

With that you will be able to reproduce the issue and you could provide us a complete log.roo file to check it.

Regards,

jaimemm commented 8 years ago

Here you go @jcagarcia :

// Spring Roo 2.0.0.M1 [rev 33e5d76] log opened at 2015-12-22 11:51:23 project setup --topLevelPackage com.gvnix.test jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity jpa --class ~.domain.Backend entity jpa --class ~.domain.Operation entity jpa --class ~.domain.ParentValue entity jpa --class ~.domain.Alias --extends ~.domain.ParentValue entity jpa --class ~.domain.KeyValue --extends ~.domain.ParentValue entity jpa --class ~.domain.Stub field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.Backend field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.Operation field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.ParentValue field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.Alias field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.KeyValue field string --fieldName name --sizeMin 3 --sizeMax 255 --notNull --class ~.domain.Stub field set --fieldName operation --type ~.domain.Operation --class ~.domain.Backend --cardinality ONE_TO_MANY --mappedBy backend field reference --fieldName backend --type ~.domain.Backend --class ~.domain.Operation --cardinality MANY_TO_ONE field set --fieldName keyValues --type ~.domain.KeyValue --class ~.domain.Alias --cardinality ONE_TO_MANY --mappedBy alias field reference --fieldName alias --type ~.domain.Alias --class ~.domain.KeyValue --cardinality MANY_TO_ONE field reference --fieldName backend --type ~.domain.Backend --class ~.domain.Stub --cardinality MANY_TO_ONE field reference --fieldName operation --type ~.domain.Operation --class ~.domain.Stub --cardinality MANY_TO_ONE field set --fieldName parentValue --type ~.domain.ParentValue --class ~.domain.Stub --cardinality MANY_TO_MANY web mvc setup web mvc all --package ~.web web mvc finder all web mvc jquery setup web mvc jquery all web mvc datatables setup web mvc bootstrap setup jpa gvnix setup web mvc datatables add --type ~.web.StubController web mvc loupe setup web mvc loupe set --controller ~.web.StubController web mvc loupe field --controller ~.web.StubController --field parentValue

jcagarcia commented 8 years ago

Hi @jaimemm

As we could check, apply loupe field to parentValue field doesn't make sense.

Loupe field allows you to select only one item, but you're applying loupe component to a Set field... on the other hand, how are you relating ParentValue with Stub? Stub has a list of parentValues but ParentValue doesn't save a stub...

In this case, the correct way to do it, should be to create Stub stub field on ~.domain.ParentValue entity, and apply loupe component on that field. With that, when you create new ParentValue you will be able to select an existing Stub using loupefield component. (You could try with field operation of ~.domain.Stub too)

After the analysis above, we think that his is not a gvNIX error, so if you have more doubts related with loupefield component you could try to ask a question on StackOverflow