In order to create a required relationship using JDL, I found that we can do this:
entity A
entity B
relationship ManyToOne{
A{b required} to B
}
When I run the following command jhipster-uml myjdlfile.jdl I get this:
An error has occurred:
SyntaxError
At line 5, column 6.
Error message:
Expected "}" or a space but "r" found.
Apparentlly, it doesn't recognize the required .
I am using Jhipster UML v1.6.5 and Jhipster Generator v3.4.0
Any ideas?
Thanks :)
You are adding that the field b is required, but it does not exist in entity B. Create the field and give it a try.
I just tried your exemple with the last version (Jhipster Generator v3.9.1) and it's working.
Related
Goal: use a related model attribute as a filter inside a conditional expression for an annotation.
I'm currently adding some functionality to an old Django app, this app has some design issues and i have nothing to do with it. After some research I found conditional expressions, this is great and what I needed.
However I'm not being able to make it.
Let's have model A, model B and model C.
class ModelA(models.Model):
name=models.Charfield()
reference=models.ForeignKey('app.ModelB')
class ModelB(models.Model):
name=models.Charfield()
class ModelC(models.Model):
name=models.Charfield()
reference=models.ForeignKey('app.ModelB', related_name='some_reference')
bool_field=models.BooleanField()
And this is what I would like to do:
ModelA.objects.all().annotate(some_field=When(Q(reference__some_reference__bool_field=True),
then=F('reference_some_reference_name')))
This should work since it is being interpreted by python, but I get some Syntax Error from MySQL.
What am i doing wrong? Is this even possible?
This is what I'm getting:
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHEN `ParametrosPreciosProveedor`.`already_iva` = 1 THEN `ParametrosPreciosProve' at line 1")
'ParametrosPreciosProveedor' is ModelC in this example and 'already_iva' is bool_field.
I would try removing the When and then parts of the annotation. Q objects do those automatically - you don't define those terms in Python.
ModelA.objects.all().annotate(some_field=Q(reference__some_reference__bool_field=True),
F('reference_some_reference_name')))
Check out the docs to see how to use Q()
This is driving me mad at the moment, if anyone can help it would be much appreciated!! This is simple enough in Java, but when called from groovy I cannot get multiple gbc properties defined in a single constraint.
I have read on a couple of old posts on the net that GridBagConstraints properties such as gridx etc can be added as follows from here.
code snippet of interest:
label(text:'Username', constraints:gbc(gridx:0,gridy:0,gridwidth:2))
However this won't work for me and I didn't expect it to as the syntax appears to be from years ago so I assume an old API. (error message below when I try the above)
Caught: java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string (or null)
I can't see how this could work as as surely the format needs to be:
GridBagConstraints gbc = new GridBagConstraints()
label("Username: ", constraints:gbc.gridx=0)
The two lines of code above run, but then I have the problem that I can't add more than one entry in the 'constraints:' section, and obviously I need to add 'gridy=0' etc.
Has anybody got any solution on how this should work?
Thanks
Taylor.
I am new in Fortran. So I need help.
I'm using gfortran on SUSE to compile my code and receive the following error:
DELTAL = SIGN (.1,(GFIX-GAMFLT))
1
Error: 'b' argument of 'sign' intrinsic at (1) must be the same type and kind as 'a'
Main file for code is attached in the below link where at 3509 line shows the error
https://files.engineering.com/getfile.aspx?folder=d55e28c0-10bf-4c50-b07f-c1de071c9567&file=sftol.f
How to fix this one?
This problem was finally solved as follows:
DELTAL = SIGN (0.1D0,(GFIX-GAMFLT))
This seems it preserves the basic datatype of the original code. It does compile successfully.
Thanks to all for your suggestions.
I am trying to add entries to a entity which contains bracket.
eg: project 1(new)
This throws back an error:
Error parsing Entity 'project_name': Syntax Error in input 'project
1(new)'. Incorrect token '(' at position 32. Brackets can only be used
with parameterized entities.
Any solutions how to train it?
Added Image below Dialog Flow error image
You are using reserved characters for synonyms (parenthesis are reserved).
You can use them as value so you can retrieve this value with parenthesis but you need to clean it from synonyms, see the image:
Adding parenthesis to value (so in this sample, I must clean parenthesis - "Sinop Br" and "Sinop Brazil" from synonyms but I can preserve parenthesis on the value "Sinop (Br)" so this value can be used at backend)
Best regards
I am trying to do an XSL transform on an xml structure in a bpel assignment statement. There is a syntax problem, but I am having trouble finding official documentation. There are examples all over the internet but I have not found a clear explanation. Here is my best shot. What do the last two parameters do? Why is eclipse saying the first argument must be a literal, even though test3.xsl is a string?
<bpel:assign validate="yes" name="Assign">
<bpel:copy keepSrcElementName="no">
<bpel:from>
<![CDATA[bpel:doXslTransform("test3.xsl", $personalInfoServiceOutput.parameters), "middle", $positionSkillManagementInput]]>
</bpel:from>
<bpel:to variable="positionSkillManagementInput"></bpel:to>
</bpel:copy>
</bpel:assign>
The signature of doXSLTransform looks as follows:
object bpel:doXslTransform(string, node-set, (string, object)*)
The first parameter is the name of the XSLT script, the second parameter is an XPath identifying the source document (e.g. a variable, part, nodeset, node). The third and the fourth parameter is a key-value pair, the string is the key and the object is the value. Those pairs are mapped into the script's parameter context so that you can access these values by their name in the script. There can be any number of these pairs.
The best resource to look up such things is the WS-BPEL 2.0 specification, doXSLTransform is described in Sect. 8.4
When I use the following code :
<bpel:copy keepSrcElementName="no">
<bpel:from>
<![CDATA[bpel:doXslTransform("parseSample.xsl", $output.payload)]]>
</bpel:from>
<bpel:to variable="output"></bpel:to>
</bpel:copy>
I also get the error, that first argument must be literal string.
But, when I deploy my service (with error) to wso2 bps, it works fine.
You can try with this.
I faced the same issue. Agree with NGoyal. Shows error in BPEL but works when deployed.