Re: [hibernate-dev] [OGM] Checkstyle rule failing in Windows
by Davide D'Alto
Thanks you Gunnar,
Davide
On Thu, Apr 25, 2013 at 12:07 PM, Gunnar Morling <gunnar(a)hibernate.org>wrote:
>
> Am 25.04.2013 12:34 schrieb "Davide D'Alto" <davide(a)hibernate.org>:
>
> >
> > Thanks Guillaume,
> > are you going to test it on Windows isn't?
> >
> > We still need a volunteer with a Mac.
>
> I can do that.
>
> --Gunnar
>
> >
> >
> > On Thu, Apr 25, 2013 at 11:10 AM, Guillaume SCHEIBEL <
> > guillaume.scheibel(a)gmail.com> wrote:
> >
> > > hello,
> > >
> > > I'm checking and keep you up to date.
> > >
> > > Guillaume
> > >
> > >
> > > 2013/4/25 Davide D'Alto <davide(a)hibernate.org>
> > >
> > >> Hi,
> > >> we have a problem with one of the rules in checkstyle:
> NewLineAtEndOfFile
> > >>
> > >> It seems that this rule in Windows is using the wrong character to
> check
> > >> if
> > >> there is a new line at the end of a file.
> > >>
> > >> To solve this issue I've tried to remove the rule and use a regular
> > >> expression instead.
> > >> The problem is that I don't have Windows or a Mac to test it.
> > >>
> > >> Is there anyone that could check the pull request on WIndows and/or
> Mac?
> > >>
> > >> The link to the pull request is
> > >> https://github.com/hibernate/hibernate-ogm/pull/183
> > >>
> > >> Thanks,
> > >> Davide
> > >> _______________________________________________
> > >> hibernate-dev mailing list
> > >> hibernate-dev(a)lists.jboss.org
> > >> https://lists.jboss.org/mailman/listinfo/hibernate-dev
> > >>
> > >
> > >
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
>
11 years, 8 months
[OGM] Checkstyle rule failing in Windows
by Davide D'Alto
Hi,
we have a problem with one of the rules in checkstyle: NewLineAtEndOfFile
It seems that this rule in Windows is using the wrong character to check if
there is a new line at the end of a file.
To solve this issue I've tried to remove the rule and use a regular
expression instead.
The problem is that I don't have Windows or a Mac to test it.
Is there anyone that could check the pull request on WIndows and/or Mac?
The link to the pull request is
https://github.com/hibernate/hibernate-ogm/pull/183
Thanks,
Davide
11 years, 8 months
Mapping different objects with a single table
by Teresa Batista Neto
Dear all,
We have a java class that contains a list of names of type A, a list of
names of type B, and a preferred name. We would like to map this list of
names and the preferred name in a single table called names that contains
id, name and type. I already had a look in hibernate documentation but I
didn't find how to do that. Can someone help me with this issue? I'm stuck
in this problem, any help will be great.
e.g.
public class Entry
{
private String preferredName;
private List<String> synsNames = new ArrayList<String>();
private List<String> locusNames = new ArrayList<String>();
private List<String> orfNames = new ArrayList<String>();
...
}
CREATE TABLE names (
name_id number NOT NULL,
entry_id number NOT NULL,
name varchar(200) NOT NULL,
type_id number NOT NULL,
CONSTRAINT pk_name PRIMARY KEY (name_id),
CONSTRAINT uq_name UNIQUE (entry_id, name)
);
plus foreign key between entry and names...
optional table type or instead of type_id just type..
Thanks in advance,
Teresa
11 years, 8 months
[HV] Making dependency to Unified EL optional or not?
by Gunnar Morling
Hi all,
Hardy and I are heads-down in a discussion [1] about an HV issue [2] and
would like to get some input from others.
Background: BV 1.1/HV 5 allow to use Unified EL in constraint violation
messages which enables dynamic messages, advanced formatting options etc.
Problem: The scope of the EL dependencies (API and impl) in HV is
"provided", since they are typically contributed by the container under
Java EE and thus HV shouldn't pull them in transitively. For Java SE this
means though that the user has to explicitly provide these dependencies
which is easy to forget.
Proposed solution: HV-784 is about making this step on SE only then
required if EL actually is used in error messages. If EL is not used, the
user wouldn't have to add the dependencies. EL is required when the user
* works with ${...} expressions in his constraint messages
* applies the built-in @DecimalMax/Min constraints which use EL in their
default messages as of HV 5
Pro's:
* EL dependencies only required if EL is actually used (fewer dependencies,
smaller application)
* Update from HV 4 to 5 works for more users out of the box (simple version
update instead of adding two more dependencies which are potentially not
used)
Con's:
* More complex implementation (requires reflective check whether EL types
are present)
* More complex rules for the user for setting up the class path
What do you other folks think, should the suggested feature be implemented
or not? We're looking forward to your opinion, also feel free to join the
discussion on the PR.
Thanks,
--Gunnar
[1] https://github.com/hibernate/hibernate-validator/pull/241
[2] https://hibernate.atlassian.net/browse/HV-784
11 years, 8 months
Re: [hibernate-dev] [OGM] Configuration parsing
by Guillaume SCHEIBEL
Hello,
I've just created a pull request:
https://github.com/hibernate/hibernate-ogm/pull/184
BTW, the jira is OGM-282 <https://hibernate.atlassian.net/browse/OGM-282>
Guillaume
2013/4/22 Guillaume SCHEIBEL <guillaume.scheibel(a)gmail.com>
> https://hibernate.atlassian.net/browse/OGM-282
>
>
> 2013/4/22 Guillaume SCHEIBEL <guillaume.scheibel(a)gmail.com>
>
>> I'm opening a Jira so we can track it easily
>>
>> Guillaume
>>
>>
>> 2013/4/22 Sanne Grinovero <sanne(a)hibernate.org>
>>
>>> Hi Guillaume,
>>> agreed, looks like a good idea! Feel free cleanup all the
>>> configuration code, we can discuss the details in the usual pull
>>> requests.
>>>
>>> Sanne
>>>
>>> On 19 April 2013 16:01, Guillaume SCHEIBEL <guillaume.scheibel(a)gmail.com>
>>> wrote:
>>> > Hello,
>>> >
>>> >
>>> > With the time we are implementing more and more configuration
>>> properties
>>> > (especially for the MongoDB module) which makes the *DatastoreProvider
>>> more
>>> > and more heavy. And some configuration checks (the port between 1 and
>>> 65535
>>> > for instance) are done several times instead being centralized at 1
>>> place.
>>> >
>>> > The other problem is because of the "all in the DatastoreProvider"
>>> > strategy, some configuration tests can only be done once the start()
>>> method
>>> > has been called and for a module like MongoDB, the start() method will
>>> try
>>> > to make a call and so the test takes ~30sec instead of being
>>> > almost instantaneous.
>>> >
>>> > My question is what do you think about pulling out the configuration
>>> part
>>> > of the datastoreprovider (which will basically only be responsible of
>>> the
>>> > start() and stop()).
>>> > And put it into a configurationParser called from
>>> > OgmJdbcServicesInitiator.configure(). And the configuration will be
>>> > represented as an object (somehow like in ISPN) and this object will be
>>> > used by the datastoreprovider to retrieve the properties.
>>> >
>>> > I think it can help to improve both config readability and the test
>>> time.
>>> > Any thoughts ?
>>> >
>>> > Guillaume
>>> > _______________________________________________
>>> > hibernate-dev mailing list
>>> > hibernate-dev(a)lists.jboss.org
>>> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>
>>
>>
>
11 years, 8 months
Checkstyle: enforced!
by Sanne Grinovero
Hi all,
yesterday we merged checkstyle integration in Hibernate OGM: it's
going to fail the compile phase if there are violations (!).
By doing so, we also had to re-style a large portion of code, as
surprisingly even though I though we where very careful on style and
whitespace inspections, human eye is still far behind the power of
such a tool. Sorry for the conflicts this caused: we hope it's a
smaller price to pay compared to the long term benefits.
I realize this might look very inconvenient initially to have it fail
during some quick experimental hacking, but the purpose is to
encourage applying the correct autoformatting styles in your IDE: it
should not annoy you once you get use to obey the rules.
The purpose is to reduce the back-and-forth discussions for which pull
requests have been delayed for style reasons, not using tabs for
indent, missing/wrong copyright headers...
also it should reduce conflicts in the future.
This definitely will look annoying initially, but please try surviging
the initial push back and fix your style.
If it still is annoying in the long run we can discuss relaxing the
rules or demoting it from a compile failure to some warning levels. If
things don't look too bad (i.e. I don't get enough complaints) I will
soon send a pull request for Search too, and I hope other projects
will follow.
Cheers,
Sanne
11 years, 8 months
[OGM] Configuration parsing
by Guillaume SCHEIBEL
Hello,
With the time we are implementing more and more configuration properties
(especially for the MongoDB module) which makes the *DatastoreProvider more
and more heavy. And some configuration checks (the port between 1 and 65535
for instance) are done several times instead being centralized at 1 place.
The other problem is because of the "all in the DatastoreProvider"
strategy, some configuration tests can only be done once the start() method
has been called and for a module like MongoDB, the start() method will try
to make a call and so the test takes ~30sec instead of being
almost instantaneous.
My question is what do you think about pulling out the configuration part
of the datastoreprovider (which will basically only be responsible of the
start() and stop()).
And put it into a configurationParser called from
OgmJdbcServicesInitiator.configure(). And the configuration will be
represented as an object (somehow like in ISPN) and this object will be
used by the datastoreprovider to retrieve the properties.
I think it can help to improve both config readability and the test time.
Any thoughts ?
Guillaume
11 years, 8 months