Re: [hibernate-dev] Message-Templates from multiple JARs

2010-02-15 Thread Hardy Ferentschik
Hi,

Having multiple resource bundles and some custom way of specifying these  
bundles is
related to HV-238 and HV-251.

Having a ResourceBundleLocatorStrategy should solve your problem Gunnar,  
right?

The default strategy could behave like it does now and we can provide an  
additional strategy
which allows for multiple resource bundles. You would specify the strategy  
in the hibernate
config file. The names for the different resource files could also be  
specified in the
config (or maybe there is a better way!?)

--Hardy


On Mon, 15 Feb 2010 16:51:13 -0300, Gunnar Morling  
 wrote:

> I agree, there probably won't be that many 3rd-party constraint vendors  
> :-)
>
> Nevertheless I think the problem is not too exotic. In my day job for
> example we're building a large-scale enterprise application, which is  
> made
> up of multiple JARs ("components") developed by multiple, independent
> development teams.
>
> Now it would be great, if two teams could develop independently their  
> custom
> constraints, specific to their component. As of now they would have to
> provide a unified ValidationMessages.properties, violating the  
> encapsulation
> of the components.
>
> A rather simple solution might be a meta-annotation @MessageBundle, which
> optionally could be used at constraint annotation type declarations to
> specify the name of the message bundle to be used. That way name  
> collisions
> between constraints from different JARs still could occur, but finding
> unique names should not be too hard. If that meta-annotation is not  
> given, a
> fallback to ValidationMessages.properties might be used.
>
> WDYT?
>
> Cheers, Gunnar
>
>
> 2010/2/15 Emmanuel Bernard 
>
>> Yes, you need to copy it over or more likely adapt the messages to your
>> application (in which case you don't care).
>> The problem with listing the resource bundle is that you need an order  
>> to
>> specify which has precedence over which.
>>
>> Another solution could be some sort of plugin system where 3rd party
>> constraint makers can reference automatically a resource bundle. But
>> realistically, how many 3rd party constraint makers will there be?
>>
>> The question is: is the additional complexity for the solution worth the
>> current problem?
>>
>> On 14 févr. 2010, at 22:00, Gunnar Morling wrote:
>>
>> > Hello you two,
>> >
>> > recently I thought about the following situation:
>> >
>> > * I have a JAR containing a custom constraint on the class path  
>> (could be
>> a constraint provided by some 3rd-party constraint vendor)
>> > * I have another custom constraint within the actual project itself  
>> (and
>> therefore a ValidationMessages.properties as well)
>> >
>> > Now the ValidationMessages.properties provided by the 3rd-party  
>> vendor is
>> hidden by my own ValidationMessages.properties, which - if I'm not  
>> mistaken
>> - requires me to copy the contents of the first to the latter.
>> >
>> > Is there any better solution to this problem?
>> >
>> > Maybe BV/HV should provide some means for constraint vendors to  
>> specify
>> the resource bundle containing messages? If you think, that's useful I'd
>> create a JIRA issue for that one.
>> >
>> > Thanks for any ideas,
>> >
>> > Gunnar
>>
>>

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [infinispan-dev] Querying Infinispan -- Not fetching results

2010-02-15 Thread Manik Surtani
Hi Vidya

Please post on the Infinispan user forum rather than the dev mail list.

Cheers
Manik

On 15 Feb 2010, at 13:19, Vidya Sethuraman wrote:

> Hi,
> 
> I am able to load data in cache and display. When I try to query, I am
> getting an empty list.
> Following is the code snippet. Please let me know what I am doing wrong.
> 
> -TestRecord.java
> @ProvidedId(bridge = @FieldBridge(impl = StringBridge.class))
> @Indexed(index = "testRecord")
> public class TestRecord implements Serializable {
> 
> //@Field(store = Store.YES)
>private Date today = new java.util.Date();
> //@Field(store = Store.YES)
>private Timestamp time = new Timestamp(today.getTime());
>@Field(store = Store.YES)
>private String type;
>@Field(store = Store.YES)
>private String eventType;
>@Field(store = Store.YES)
>private int loggingLevel;
>@Field(store = Store.YES)
>private String message;
> //@Field(store = Store.YES)
>private String logTime = time.toString();
> 
> ...// getters and setters
> }
> 
> -TestQuery.java--
> cache = cacheMgr.getCache();
> QueryHelper qh = new QueryHelper(cache, new Properties(), TestRecord.class);
> QueryFactory qf = new QueryFactory(cache, qh);
> CacheQuery cq = qf.getBasicQuery("message", searchText);
> auditLogRecordList = cq.list();
> int hits = cq.getResultSize();
> log.info("hits= "+ hits);
> 
> 
> The hits is appearing empty.
> 
> Regards,
> Vidya
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

--
Manik Surtani
ma...@jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org





___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] [infinispan-dev] Querying Infinispan -- Not fetching results

2010-02-15 Thread Vidya Sethuraman
Hi,

I am able to load data in cache and display. When I try to query, I am
getting an empty list.
Following is the code snippet. Please let me know what I am doing wrong.

-TestRecord.java
@ProvidedId(bridge = @FieldBridge(impl = StringBridge.class))
@Indexed(index = "testRecord")
public class TestRecord implements Serializable {

//@Field(store = Store.YES)
private Date today = new java.util.Date();
//@Field(store = Store.YES)
private Timestamp time = new Timestamp(today.getTime());
@Field(store = Store.YES)
private String type;
@Field(store = Store.YES)
private String eventType;
@Field(store = Store.YES)
private int loggingLevel;
@Field(store = Store.YES)
private String message;
//@Field(store = Store.YES)
private String logTime = time.toString();

...// getters and setters
}

-TestQuery.java--
cache = cacheMgr.getCache();
QueryHelper qh = new QueryHelper(cache, new Properties(), TestRecord.class);
QueryFactory qf = new QueryFactory(cache, qh);
CacheQuery cq = qf.getBasicQuery("message", searchText);
auditLogRecordList = cq.list();
int hits = cq.getResultSize();
log.info("hits= "+ hits);


The hits is appearing empty.

Regards,
Vidya
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev