Dawid Skrzypczynski

Ranch Hand
+ Follow
since Jun 08, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dawid Skrzypczynski

This issue is important point in my project, no one really knows? I just can't inject any beans to my service class.
10 years ago
Hi,

I am using PersistanceContext to inject EntityManager and its works when i use Java for back-end and front-end(JSF:Managed bean) but now i want to use Flex as front-end. I am using blazeds to connect between Java and Flex. I created simple test service that generates list and this is works properly. Problem is when i tried to retrieve this list from my databases it turned out that my EntityManager is not injected by PersistanceContext. What i am doing wrong ?

10 years ago
Sorry, this is complete code that i am using.


Server:


Client:
I forgot change it in my example. I using the same code when i want to connect from another machine but off course in the server and client instead localhost i am using my ip address.
Hello,

I wrote simple echo service. It works perfectly when i am using localhost but problem is when i want to connect to my server using another machine which uses different IP address. Client program don't even want to connect. He is never asking for message so problem is with connection but i don't understand why. I checked ports using netstat command and they were an open. Can you help me ?

Server:


Client:


very stupid mistake...

Thanks.
I do like this guy:
http://www.youtube.com/watch?v=fURXIkP7pWA&feature=related

but this code only create schema. I don't know why don't insert data.
Hi,
I have database: "xxx" and i want to created new schema and insert it my object. My simple code create this schema but don't save object.

Config file:


class code:


Run code:


Console:
12:51:38,390 INFO Version:15 - Hibernate Annotations 3.4.0.GA
12:51:38,437 INFO Environment:560 - Hibernate 3.3.2.GA
12:51:38,437 INFO Environment:593 - hibernate.properties not found
12:51:38,437 INFO Environment:771 - Bytecode provider name : javassist
12:51:38,453 INFO Environment:652 - using JDK 1.4 java.sql.Timestamp handling
12:51:39,000 INFO Version:14 - Hibernate Commons Annotations 3.1.0.GA
12:51:39,031 INFO Configuration:1474 - configuring from resource: hibernate.cfg.xml
12:51:39,031 INFO Configuration:1451 - Configuration resource: hibernate.cfg.xml
12:51:39,187 INFO Configuration:1589 - Configured SessionFactory: null
12:51:39,250 INFO Dialect:175 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
12:51:39,453 INFO AnnotationBinder:419 - Binding entity from annotated class: com.hibernate.chapter1.Employe
12:51:39,546 INFO EntityBinder:422 - Bind entity com.hibernate.chapter1.Employe on table Employe
12:51:39,671 INFO AnnotationConfiguration:369 - Hibernate Validator not found: ignoring
12:51:39,781 INFO SchemaExport:226 - Running hbm2ddl schema export
12:51:39,796 DEBUG SchemaExport:242 - import file not found: /import.sql
12:51:39,796 INFO SchemaExport:251 - exporting generated schema to database
12:51:39,796 INFO DriverManagerConnectionProvider:64 - Using Hibernate built-in connection pool (not for production use!)
12:51:39,796 INFO DriverManagerConnectionProvider:65 - Hibernate connection pool size: 2
12:51:39,796 INFO DriverManagerConnectionProvider:68 - autocommit mode: false
12:51:39,812 INFO DriverManagerConnectionProvider:103 - using driver: org.postgresql.Driver at URL: jdbc:postgresql:postgres
12:51:39,812 INFO DriverManagerConnectionProvider:109 - connection properties: {user=postgres, password=****}
drop table xxx.Employe
12:51:40,000 DEBUG SchemaExport:377 - drop table xxx.Employe
12:51:40,000 DEBUG SchemaExport:362 - Unsuccessful: drop table xxx.Employe
12:51:40,000 DEBUG SchemaExport:363 - ERROR: table "employe" does not exist
create table xxx.Employe (empId int4 not null, empName varchar(255), primary key (empId))
12:51:40,000 DEBUG SchemaExport:377 - create table xxx.Employe (empId int4 not null, empName varchar(255), primary key (empId))
12:51:40,046 INFO SchemaExport:268 - schema export complete
12:51:40,046 INFO DriverManagerConnectionProvider:170 - cleaning up connection pool: jdbc:postgresql:postgres
12:51:40,062 INFO HibernateSearchEventListenerRegister:53 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
12:51:40,062 INFO DriverManagerConnectionProvider:64 - Using Hibernate built-in connection pool (not for production use!)
12:51:40,062 INFO DriverManagerConnectionProvider:65 - Hibernate connection pool size: 2
12:51:40,062 INFO DriverManagerConnectionProvider:68 - autocommit mode: false
12:51:40,062 INFO DriverManagerConnectionProvider:103 - using driver: org.postgresql.Driver at URL: jdbc:postgresql:postgres
12:51:40,062 INFO DriverManagerConnectionProvider:109 - connection properties: {user=postgres, password=****}
12:51:40,125 INFO SettingsFactory:114 - RDBMS: PostgreSQL, version: 9.1beta3
12:51:40,125 INFO SettingsFactory:115 - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 9.1devel JDBC4 (build 900)
12:51:40,156 INFO Dialect:175 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
12:51:40,156 INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions)
12:51:40,156 INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
12:51:40,156 INFO SettingsFactory:161 - Automatic flush during beforeCompletion(): disabled
12:51:40,156 INFO SettingsFactory:165 - Automatic session close at end of transaction: disabled
12:51:40,156 INFO SettingsFactory:172 - JDBC batch size: 15
12:51:40,156 INFO SettingsFactory:175 - JDBC batch updates for versioned data: disabled
12:51:40,171 INFO SettingsFactory:180 - Scrollable result sets: enabled
12:51:40,171 INFO SettingsFactory:188 - JDBC3 getGeneratedKeys(): enabled
12:51:40,171 INFO SettingsFactory:196 - Connection release mode: auto
12:51:40,171 INFO SettingsFactory:214 - Default schema: xxx
12:51:40,171 INFO SettingsFactory:223 - Default batch fetch size: 1
12:51:40,171 INFO SettingsFactory:227 - Generate SQL with comments: disabled
12:51:40,171 INFO SettingsFactory:231 - Order SQL updates by primary key: disabled
12:51:40,171 INFO SettingsFactory:235 - Order SQL inserts for batching: disabled
12:51:40,171 INFO SettingsFactory:397 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:51:40,171 INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory
12:51:40,171 INFO SettingsFactory:243 - Query language substitutions: {}
12:51:40,171 INFO SettingsFactory:248 - JPA-QL strict compliance: disabled
12:51:40,171 INFO SettingsFactory:253 - Second-level cache: enabled
12:51:40,171 INFO SettingsFactory:257 - Query cache: disabled
12:51:40,187 INFO SettingsFactory:382 - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
12:51:40,187 INFO RegionFactoryCacheProviderBridge:61 - Cache provider: org.hibernate.cache.NoCacheProvider
12:51:40,187 INFO SettingsFactory:267 - Optimize cache for minimal puts: disabled
12:51:40,187 INFO SettingsFactory:276 - Structured second-level cache entries: disabled
12:51:40,203 INFO SettingsFactory:296 - Echoing all SQL to stdout
12:51:40,203 INFO SettingsFactory:305 - Statistics: disabled
12:51:40,203 INFO SettingsFactory:309 - Deleted entity synthetic identifier rollback: disabled
12:51:40,203 INFO SettingsFactory:324 - Default entity-mode: pojo
12:51:40,203 INFO SettingsFactory:328 - Named query checking : enabled
12:51:40,296 INFO SessionFactoryImpl:193 - building session factory
12:51:40,343 INFO DriverManagerConnectionProvider:170 - cleaning up connection pool: jdbc:postgresql:postgres
12:51:40,703 INFO SessionFactoryObjectFactory:105 - Not binding factory to JNDI, no JNDI name configured
I changed coord. and instead of draw i used fill and now works. I see that i could used UIManager to get the same effect.
I wonder if there is any possibility to add custom shape to button. For example circle. If i draw circle using MetalButtonUI he will be inside the square or rectangle. Maybe i paste image to be more specific.






btw. Darryl thanks you again
12 years ago
I am sorry you are the right. This will not happen again.
12 years ago
Hi,
That is what you want ?

12 years ago
Coordinates
If i good understood this article and you my button has this coordinates:
x: 0
y: 0
c.getWidth()
c.getHeight()

but still it is the same. this is my corrected code:

12 years ago
Sorry you have right but if i add size manually that won't work. example:


12 years ago
Hi,
I know that i had similar problem recently and i should to do it yourself but i tried many times and I was looking for solution without success.

I know that is possibility to add various graphics for different state: pressed etc. but i want to create button not only in the shape of a Rectangle or Square. I just want to more graphics control for my swing components.



Method paint is invoked but the Rectangle is not drawn. The Graphics is not displayed but if i change something for parameters component for example

this work

What is wrong ?
12 years ago