Re: [hibernate-dev] Scanner contract
by Steve Ebersole
Not saying the use of platform/environemtn specific url protocols is
bad in any way. Just saying that I think it is unreasonable to code in
Hibernate handling for all these protocols. JBoss VFS, for example, is
much better handled using JBoss VirtualFile API. OSGi protocols will
require very special handling as well, though it *seems* like we may be
able to stick to standard OSGi APIs rather than vendor specific APIs
(but I dont know that for sure yet).
On Sun 17 Mar 2013 03:59:15 PM CDT, Steve Ebersole wrote:
> Not saying the use of platform/environemtn specific url protocols is
> bad in any way. Just saying that I think it is unreasonable to code
> in Hibernate handling for all these protocols. JBoss VFS, for
> example, is much better handled using JBoss VirtualFile API. OSGi
> protocols will require very special handling as well, though it
> *seems* like we may be able to stick to standard OSGi APIs rather than
> vendor specific APIs (but I dont know that for sure yet).
>
>
> On Sat 16 Mar 2013 08:29:54 PM CDT, Ales Justin wrote:
>>> I should point out this is based on what we saw when Brett initially
>>> worked with Karaf, especially in the Enterprise OSGi use cases. The
>>> incoming PersistenceUnitInfo contained no urls other than the root
>>> url, which happened to be an osgi bundle url (the protocol was
>>> "bundle"). To me, interpreting all these goofy url schemes is best
>>> left to the environment that defines those schemes. Not much unlike
>>> JBoss AS and its VFS-based urls.
>>
>> Yeah, scanning and funky urls are always a problem.
>>
>> Well, the funky urls are there for a reason -- we can discuss them
>> over beer next time. :-)
>> And in most cases they don't represent a problem,
>> unfortunately resource scanning is not one of those cases.
>>
>> But, imo, any decent framework should account for this,
>> if nothing else, for optimisation reasons.
>>
>> e.g. I pushed a patch to DataNucleus, Spring, Drools, Facelets, ...
>> just b/c of this
>>
>> And Emmanuel and me are the culprits behind initial Scanner. :-)
>>
>> -Ales
>>
>>
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
11 years, 9 months
strategies for truncating identifiers
by Brett Meyer
I've been working a bit on HHH-1904 [1] -- truncating identifiers based on a maximum length provided by the Dialect. As an example, a quick test that has a variety of uniques produced the constraint names in [2].
My initial strategy took metamodel's ObjectName and modified it to automatically handle name segments and quoting. For example, `UK_FooClass_1` would be broken down into "UK", "FooClass", and "1" segments, "_" would be the delimiter, and quoting would be added back in whenever necessary.
I'm trying to find a decent strategy for truncating the name, either as a whole or with each segment. The problem that I keep running into is that it's going to be difficult to dynamically ensure that naming collisions are avoided. For example, if embedded classes are used as entities, you could have 2 constraint names like "UK_OuterClass$InnerClassA_1" and "UK_OuterClass$InnerClassB_1". If the middle segment is truncated at or before the "$", it won't work.
Should we try to enforce a rule that the "unique bits" be in a specific segment or position? Alternatively, "truncate" by hashing the name (as we do with FK names now -- of course, no human readability)? Any other ideas?
Admittedly, I may be overthinking it. It's primarily the Hibernate-generated constraint names that we need to worry about...
[1] https://hibernate.onjira.com/browse/HHH-1904
[2] https://gist.github.com/brmeyer/bfbc78c770904cc6fca8
Brett Meyer
Red Hat Software Engineer, Hibernate
11 years, 9 months
'key-many-to-one-element' and 'on-delete'
by Łukasz Antoniak
Hello Team,
What do you think about adding "on-delete" attribute to
"key-many-to-one-element" type in HBM mapping? This would allow
generation of "ON DELETE CASCADE" clause.
Context: "HHH-7807 - Deleting Revision Entity" and "HHH-8052 -
Possibility to deleted audits/revisions in an orderly way".
Regards,
Lukasz Antoniak
11 years, 9 months
Someone doing forum maintenance?
by Sanne Grinovero
I'm getting this error when attempting to login to the forums:
It was not possible to convert your password when updating this
bulletin board’s software. Please request a new password. If you
continue to have problems please contact the Board Administrator.
Someone is working on it?
Sanne
11 years, 9 months
cascading deletion issue
by Teresa Batista Neto
Dear all,
I'm trying to use cascading deletion but it doesn't seem to work.
"
If you can guarantee that no other object (or row in any other table) holds
a reference to these bids, you can make the deletion transitive.
Hibernate (and JPA) offer a cascading option for this purpose. You can
enable cascading for the delete operation
<set name="bids" inverse="true" cascade="save-update, delete">
"
Only works for me if I'm mapping to a Set... If I use List it stops working
and returns java.util.ConcurrentModificationException...
Any ideas?
<class name="SimpleDatabase" table="TERM">
.....
<list name="optionalFields"
table="OPTIONAL_FIELD"
lazy="false"
fetch="subselect"
inverse="true"
cascade="save-update, delete, delete-orphan"
>
<key column="TERM_ID"/>
<list-index column="FIELD_ORDER" base="1"/>
<one-to-many class="SimpleDatabaseOptionalField"/>
</list>
</class>
<class name="SimpleDatabaseOptionalField" table="OPTIONAL_FIELD">
<id name="fieldId" column="FIELD_ID" type="integer">
<generator class="sequence">
<param name="sequence">SEQ_XREFDB</param>
</generator>
</id>
<property name="termId" column="TERM_ID" type="integer"/>
<property name="fieldOrder" column="FIELD_ORDER" type="integer"
not-null="true" />
<property name="description" column="DESCRIPTION" type="string"
not-null="true"/>
<property name="xmlPropertyName" column="XML_PROPERTY_NAME"
type="string" not-null="true"/>
<property name="rdfPropertyName" column="RDF_PROPERTY_NAME"
type="string" not-null="true"/>
</class>
Thanks in advance,
Teresa
11 years, 9 months
Re: [hibernate-dev] Fwd: Hibernate-ehcache 4.1.10.Final
by Marc Schipperheyn
You're right. I was thrown off by a problem in my local maven rep which
lead to Eclipse reporting that it couldn't find those libs and the sorting
as I checked it. Sorry.
Vriendelijke groet,
Marc
M.Schipperheyn
<http://www.buscafreela.com.br>
MSW BV | Nova Zemblastraat 12-a, 1013 RK, Amsterdam | KvK: 02090184
skype: mschipperheyn | Twitter: mschipperheyn
Netherlands: m: +31 (0)6 218 03 003 | t: +31 (0)84 88 453 99
Brazil: m: +55 (0)11 99 44 6 3472
On Mon, Mar 4, 2013 at 6:26 PM, Steve Ebersole <steven.ebersole(a)gmail.com>wrote:
> Most repositories disable browsing, but only at the root level.
> Personally, I like to go directly to the url and see if the thing is there
> (or as Guillaume suggests using one of the search sites).
>
> https://repository.jboss.org/**nexus/content/groups/public/**
> org/hibernate/hibernate-core/**4.1.10.Final/<https://repository.jboss.org/nexus/content/groups/public/org/hibernate/hi...>
> https://repository.jboss.org/**nexus/content/groups/public/**
> org/hibernate/hibernate-**ehcache/4.1.10.Final/<https://repository.jboss.org/nexus/content/groups/public/org/hibernate/hi...>
> ...
> http://repo1.maven.org/maven2/**org/hibernate/hibernate-core/**
> 4.1.10.Final/<http://repo1.maven.org/maven2/org/hibernate/hibernate-core/4.1.10.Final/>
> http://repo1.maven.org/maven2/**org/hibernate/hibernate-**
> ehcache/4.1.10.Final/<http://repo1.maven.org/maven2/org/hibernate/hibernate-ehcache/4.1.10.Final/>
> etc
>
> As you can see, there are clearly there...
>
>
> On Mon 04 Mar 2013 03:02:15 PM CST, Guillaume Smet wrote:
>
>> On Mon, Mar 4, 2013 at 9:49 PM, Marc Schipperheyn
>> <m.schipperheyn(a)gmail.com> wrote:
>>
>>> repo1.maven.org
>>> repo2.maven.org
>>>
>>
>> It's in these repos as we are using them and you can find the artifact
>> on search.maven.org.
>>
>> repository.jboss.org/nexus
>>>
>>
>> https://repository.jboss.org/**nexus/index.html#nexus-search;**
>> gav~org.hibernate~hibernate-**core~~~~kw,versionexpand<https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.hibern...>
>> It's not sorted correctly... You can find 4.1.10.Final just above
>> 4.1.1.Final.
>>
>> mvnrepository.com
>>>
>>
>> They are supposed to index Maven Central and I can assure you the
>> artifacts are there as we are getting them from there. So something is
>> wrong in mvnrepository.com.
>>
>> I usually recommend to use search.maven.org to browse Central.
>>
>>
11 years, 9 months