Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for template parameter dependencies #21

Merged
merged 2 commits into from
Apr 19, 2017
Merged

Support for template parameter dependencies #21

merged 2 commits into from
Apr 19, 2017

Conversation

pnaw94
Copy link
Contributor

@pnaw94 pnaw94 commented Apr 19, 2017

This change is Reviewable

@pnaw94 pnaw94 requested a review from pgesek April 19, 2017 13:40
@pgesek pgesek requested a review from palbecki April 19, 2017 13:54
@Column(columnDefinition = TEXT_COLUMN_DEFINITION, nullable = false)
@Getter
@Setter
private String placeholder;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically we want to be able to change selectExpression for parameter, depending on other parameters' values (those would be query parameters for url).

--

ALTER TABLE ONLY jasper_template_parameter_dependencies
ADD CONSTRAINT fkpxphnoksec55h63evgb3obfxq FOREIGN KEY (parameterid) REFERENCES template_parameters(id);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we want to have better constraint names?

);

--
-- Name: jaspertemplateparameter_options fkpxphnoksec55h63evgb3obfxq; Type: FK CONSTRAINT; Schema: reports; Owner: postgres

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options?

@@ -323,7 +331,7 @@ public void mapRequestParametersToTemplateShouldReturnEmptyMapIfNoTemplateParame
@Test
public void mapRequestParametersToTemplateShouldReturnEmptyMapIfNoRequestParameters() {
JasperTemplateParameter templateParameter = new JasperTemplateParameter(template, PARAM1,
null, null, null, null, null, null, null, null, null);
null, null, null, null, null, null, null, null, null, null);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use no_args constructor and setters?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palbecki @pnaw94 I see this pull request has already been merged, but I think it's worth it to mention that even though there's the NoArgsConstructor annotation, we shouldn't use it in our code. It's there for Hibernate. I can see why the AllArgsConstructor was removed, but the NoArgs one doesn't seem to better, especially since a template parameter object should have some things set at construction time.

Ideally, we would create a constructor (or static factory method) with parameters that make sense; that seems more object-oriented.

@pnaw94
Copy link
Contributor Author

pnaw94 commented Apr 19, 2017

@palbecki please review the newest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants